This is my solution 900MS

  • 0

    select d.Name Department, e.Name Employee, e.Salary Salary from Employee e inner join (select departmentid, max(salary) salary from Employee group by DepartmentId) m inner join Department d on = e.departmentid where e.departmentid = m.departmentid and e.salary = m.salary;

Log in to reply

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.