select a.Name as Department,c.Name as Employee, b.Salary
(select DepartmentId, max(Salary) as Salary
group by 1) b on a.Id = b.DepartmentId
Employee c on b.DepartmentId = c.DepartmentId and b.Salary = c.Salary
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.