[ORACLE_SQL](LEET_CODE)570. Managers with at Least 5 Direct Reports

이경영·2023년 7월 19일
0

오라클

목록 보기
30/43

https://leetcode.com/problems/managers-with-at-least-5-direct-reports/description/?envType=study-plan-v2&envId=top-sql-50

/* Write your PL/SQL query statement below */
select  b.name
from employee a 
inner join employee b
on a.managerId = b.id
group by b.name
having count(b.name) >=5
  • 셀프조인을 활용하는 방법.
  • 그룹바이 함수로 한 컬럼만 그룹바이 한 뒤 그에 대한 조건으로 count를 거는 방법을 썼다.
profile
꾸준히

0개의 댓글