题解 | #获取每个部门中当前员工薪水最高的相关信息#
获取每个部门中当前员工薪水最高的相关信息
https://www.nowcoder.com/practice/4a052e3e1df5435880d4353eb18a91c6
select a.dept_no,a.emp_no,a.salary from( select t1.dept_no,t1.emp_no,t2.salary, row_number() over(partition by t1.dept_no order by t2.salary desc) as rn from dept_emp t1 left join salaries t2 on t1.emp_no =t2.emp_no )a where a.rn=1