row_number() over()


  • 0
    X

    select * from (
    select row_number() over(partition by e.departmentid order by e.Salary desc) as rank, d.name as Department, e.name as Employee, e.Salary
    from Employee e, Department d
    where e.DepartmentId =d.id ) t
    where rank <=3


Log in to reply
 

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