思路:用聚合函数对部门分组后对薪资排序,再筛选出排名为1的人的信息selectdept_no,emp_no,salaryfrom(selecta.dept_no,a.emp_no,salary,DENSE_RANK() over(partition by dept_no order by salary desc) as s_rankfrom dept_emp a join salaries b on a.emp_no=b.emp_no) awhere s_rank=1;