题解 | #获取每个部门中当前员工薪水最高的相关信息#
获取每个部门中当前员工薪水最高的相关信息
https://www.nowcoder.com/practice/4a052e3e1df5435880d4353eb18a91c6
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 salary desc) rk from dept_emp d join salaries s on d.emp_no=s.emp_no ) t where t.rk=1 order by t.dept_no