使用窗口函数开窗口,计算名次。然后使用子查询 SELECT t.dept_no, t.emp_no, t.salary FROM ( SELECT d.dept_no, s.emp_no, s.salary, rank() over( partition by d.dept_no order by s.salary desc ) ranking FROM salaries s join dept_em...