题解 | #获取每个部门中当前员工薪水最高的相关信息#
获取每个部门中当前员工薪水最高的相关信息
http://www.nowcoder.com/practice/4a052e3e1df5435880d4353eb18a91c6
select a.dept_no,a.emp_no,b.salary maxSalary from dept_emp a join salaries b on a.emp_no=b.emp_no where (a.dept_no,b.salary) in (select a.dept_no,max(salary) from dept_emp a join salaries b on a.emp_no=b.emp_no group by a.dept_no) and a.to_date='9999-01-01' order by a.dept_no