SELECT E.Name FROM Employee E, (SELECT ManagerId FROM Employee GROUP BY ManagerId HAVING count(*) >= 5) M WHERE E.Id = M.ManagerId;
@yaozyforwork Try to use JOIN rewrite your code.
Most people may come to the
IN solution very easily. But the performance is not good as expected. So please try to rewrite using
JOIN, which is more efficient.
@yaozyforwork I tested again and it's work for me.
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.