leet code sql 1050

문제
- 배우와 감독이 최소 3회 이상 같은 업무를 한 경우
문제 접근
- group by를 사용하여 처리
- timestamp가 unique하다고 하여 distinct를 걸어주지 않아도 되지만, 혹시나의 경우를 대비하여 추가
1
2
3
4
5
6
select
actor_id,
director_id
from ActorDirector
group by 1,2
having count(distinct timestamp) >= 3