Easy to understand beats 90%

  • 0

    select d.name as department,
    e.name as Employee,
    e.salary from employee e
    inner join
    Department d
    on e.Departmentid = d.id
    where (d.id,salary) in(
    select Departmentid, max(salary)
    from employee e
    group by e.departmentid)

Log in to reply

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