43 - 部门工资前三高的所有员工
# dense_rank 排名
select
Department,
Employee,
Salary
from
(
select
d.name as Department,
e.name as Employee,
e.salary as Salary,
(dense_rank() over (partition by d.name order by e.salary desc)) as ranking
from
Employee e left join Department d on e.departmentId=d.id
) as t
where
ranking<=3;