select d.Name Department, e1.Name Employee, e1.Salary
from Employee e1, Employee e2, Department d
where e1.Salary <= e2.Salary and e1.DepartmentId = e2.DepartmentId and e1.DepartmentId = d.Id
group by e1.DepartmentId, e1.Id
having count(distinct e2.Salary) = 1;
My solution, not fastest, but one select
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.