Why my solution is not acepted?


  • 0
    M

    select selection.department, selection.Employee, selection.salary
    from
    (select d.name department, e.name as employee, max(e.salary) as Salary,
    rank() over(partition by d.name order by salary desc)
    from employee_2 e inner join department d
    on e.departmentid = d.id
    group by d.name, e.name, e.salary
    --order by d.name, e.salary desc
    ) Selection
    where selection.rank = 1


Log in to reply
 

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