题解 | #获取每个部门中当前员工薪水最高的相关信息#
获取每个部门中当前员工薪水最高的相关信息
http://www.nowcoder.com/practice/4a052e3e1df5435880d4353eb18a91c6
select c.dept_no,c.emp_no,c.salary max_Salary from (select dept_no,a.emp_no,b.salary, RANK() over (partition by dept_no order by salary desc) r from dept_emp a,salaries b where a.emp_no=b.emp_no and a.from_date<=b.from_date and a.to_date>=b.to_date) c where r=1