[코드카타] SQL 28 Managers with at Least 5 Direct Reports

Data_Student·2024년 11월 12일
0

코드카타

목록 보기
35/57

[코드카타] SQL 28 Managers with at Least 5 Direct Reports

28. Managers with at Least 5 Direct Reports
https://leetcode.com/problems/managers-with-at-least-5-direct-reports/description/

Write a solution to find managers with at least five direct reports.
Return the result table in any order.
select name
from employee
where id in (
    select managerId
    from employee
    group by managerId
    having count(*) >= 5
    )
Join을 사용한 방법도 있음

0개의 댓글