select department, employee_name, salary from ( select department, employee_name, salary,rank() over(partition by department order by salary desc) as rk from employees )a where a.rk<3 order by a.department,a.salary desc
rank 又重复,又跳行
select department, employee_name, salary from ( select department, employee_name, salary,rank() over(partition by department order by salary desc) as rk from employees )a where a.rk<3 order by a.department,a.salary desc
rank 又重复,又跳行