写法一
select a.name
from Employee a
where a.id = (
select b.managerId
from Employee b
where a.id = b.managerId
group by b.managerId
having COUNT(*) >= 5
);
写法二,构建临时表tmp
select a.name
from Employee as a
join (
select managerId
from Employee
group by managerId
having COUNT(*) >= 5
) as tmp
on a.id = tmp.managerId;