利用row_number()对部门分组并按薪水排序,然后取row_n=1的部门编号,员工编号,薪水select b.dept_no, b.emp_no, b.salary from(select *, row_number() over (partition by r.dept_no order by r.salary desc) as row_n from(select d.dept_no,d.emp_no,s.salary from salaries s, dept_emp d where d.emp_no = s.emp_no) as r) as bwhere row_n = 1;