[LeetCode] 1050. Actors and Directors Who Cooperated At Least Three Times

2022. 6. 9. 22:35SQL

SELECT actor_id,
    director_id
FROM ActorDirector
GROUP BY 1, 2
HAVING count(*)>=3

 

GROUP BY 1, 2로 설정

이 경우 COUNT(*)에 그룹 1,2별로 카운트 됨

'SQL' 카테고리의 다른 글

[LeetCode] 626. Exchange Seats  (0) 2022.06.09
[LeetCode] 180. Consecutive Numbers  (0) 2022.06.09
[LeetCode] 197. Rising Temperature  (0) 2022.06.09
[HackerRank] Weather Observation Station 5  (0) 2022.06.08
[HackerRank] Weather Observation Station 3  (0) 2022.06.07