题解 | #获取每个部门中当前员工薪水最高的相关信息#
获取每个部门中当前员工薪水最高的相关信息
https://www.nowcoder.com/practice/4a052e3e1df5435880d4353eb18a91c6
select dept_no, sa.emp_no, salary from dept_emp de join salaries sa on de.emp_no = sa.emp_no where sa.to_date = '9999-01-01' and (dept_no,salary) in( select dept_no,max(salary) from dept_emp de join salaries sa on de.emp_no = sa.emp_no group by dept_no ) order by dept_no
新思路,查找速度提升20%