why this not working

  • 0

    select a.Name as Department,c.Name as Employee, b.Salary
    Department a
    left join
    (select DepartmentId, max(Salary) as Salary
    from Employee
    group by 1) b on a.Id = b.DepartmentId
    left join
    Employee c on b.DepartmentId = c.DepartmentId and b.Salary = c.Salary

Log in to reply

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