570. Managers with at Least 5 Direct Reports

SELECT Name
FROM Employee e1
JOIN
(SELECT ManagerId
FROM Employee
GROUP BY ManagerId
HAVING COUNT(ManagerId) >= 5) e2
ON e1.Id = e2.ManagerId
;

 

posted @ 2018-12-23 02:41  yuesi  阅读(75)  评论(0编辑  收藏  举报