当前位置:网站首页>[leetcode database 1050] actors and directors who have cooperated at least three times (simple question)
[leetcode database 1050] actors and directors who have cooperated at least three times (simple question)
2022-07-26 08:56:00 【Evening scenery at the top of the mountain】
One 、 subject

Two 、 Code
- Because it requires the cooperation of actors and directors That is to say
actor_idanddirector_idMust be the same to meet the conditions So we need to add two grouping conditions groupby. Because if the grouping condition is not addeddirector_idthatCOUNT(*)What counts is the number of collaborations between the actor and all directors Rather than the number of collaborations with various directors In the fourth example of the test, there will be errors . - use GROUP BY After grouping, you can use
HAVINGTake out the desired group .SQL In the use ofHAVINGWhen clause SELECT The order of statements is :FROM → WHERE → GROUP BY → HAVING → SELECT → ORDER BY.
# Write your MySQL query statement below
SELECT actor_id, director_id
FROM ActorDirector
GROUP BY actor_id, director_id
HAVING COUNT(*) >= 3;
边栏推荐
- Oracle 19C OCP 1z0-082 certification examination question bank (13-18)
- JDBC database connection pool (Druid Technology)
- Database operation topic 1
- Web概述和B/S架构
- Uploading pictures on Alibaba cloud OSS
- Foundry tutorial: writing scalable smart contracts in various ways (Part 1)
- Media at home and abroad publicize that we should strictly grasp the content
- Kept dual machine hot standby
- Database operation skills 6
- Ueditot_ JSP SSRF vulnerability recurrence
猜你喜欢
![[search topics] flood coverage of search questions after reading the inevitable meeting](/img/54/ce672d21a4a67110ee629dde3cb9dc.png)
[search topics] flood coverage of search questions after reading the inevitable meeting

正则表达式:判断是否符合USD格式

Transfer guide printing system based on C language design

数据库操作技能7

node的js文件引入

Learning notes of automatic control principle - Performance Analysis of continuous time system

What are the contents of Oracle OCP and MySQL OCP certification exams?

node-v下载与应用、ES6模块导入与导出
![[eslint] Failed to load parser ‘@typescript-eslint/parser‘ declared in ‘package. json » eslint-confi](/img/39/135d29dae23b55497728233f31aa6a.png)
[eslint] Failed to load parser ‘@typescript-eslint/parser‘ declared in ‘package. json » eslint-confi

合工大苍穹战队视觉组培训Day6——传统视觉,图像处理
随机推荐
[recommended collection] MySQL 30000 word essence summary index (II) [easy to understand]
After MySQL 8 OCP (1z0-908), hand in your homework
[untitled]
Pytoch learning - from tensor to LR
机器学习中的概率模型
数据库操作 题目一
Vision Group Training Day5 - machine learning, image recognition project
Foundry tutorial: writing scalable smart contracts in various ways (Part 1)
P1825 [USACO11OPEN]Corn Maze S
P3743 kotori的设备
Replication of SQL injection vulnerability in the foreground of Pan micro e-cology8
C # use npoi to operate Excel
sklearn 机器学习基础(线性回归、欠拟合、过拟合、岭回归、模型加载保存)
Deploy prometheus+grafana monitoring platform
【加密周报】加密市场有所回温?寒冬仍未解冻 盘点上周加密市场发生的重大事件
[recommended collection] MySQL 30000 word essence summary - query and transaction (III)
CSDN Top1 "how does a Virgo procedural ape" become a blogger with millions of fans through writing?
Store a group of positive and negative numbers respectively, and count the number of 0 -- assembly language implementation
The lessons of 2000. Web3 = the third industrial revolution?
Hegong sky team vision training Day6 - traditional vision, image processing