LeetCode 1050. Actors and Directors Who Cooperated At Least Three Times
考点 | 难度 |
---|---|
Database | Easy |
题目
Write a SQL query for a report that provides the pairs (actor_id, director_id)
where the actor has cooperated with the director at least three times.
Return the result table in any order.
答案
SELECT actor_id, director_id
FROM ActorDirector
GROUP BY actor_id, director_id
HAVING COUNT(1) >= 3