570. Managers with at Least 5 Direct Reports

All leetcode sql solution: https://datageekinme.github.io/portfolio/zepl-0005/

select e1.Name

from [Employee] e1

inner join

(

SELECT ManagerId FROM [Employee] group by ManagerId having count(distinct Id)>=5

) e2

on e1.Id=e2.ManagerId;

posted @ 2018-10-22 09:51  ffeng0312  阅读(141)  评论(0)    收藏  举报