What is wrong with my code?

  • 0
    select b.Name as Department, a.Employee, a.Salary
    from (select DepartmentId, Name as Employee, max(Salary) as Salary
          from Employee group by DepartmentId, Name) a,
         Department b
    where a.DepartmentId=b.Id;

  • 0

    groub by A,B. First,group by A, if A is duplicated,then group by B.

Log in to reply

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