题解 | #获取每个部门中当前员工薪水最高的相关信息#

获取每个部门中当前员工薪水最高的相关信息

http://www.nowcoder.com/practice/4a052e3e1df5435880d4353eb18a91c6

评论区的答案看的我凌乱,还是自己写吧,确保正确 select dept_no,emp_no,salary maxsalary from( select de.dept_no,de.emp_no,salary,rank()over(partition by de.dept_no order by sa.salary desc) 排名 from dept_emp de join salaries sa on de.emp_no=sa.emp_no where de.to_date='9999-01-01') as xin where xin.排名=1 order by xin.dept_no

全部评论

相关推荐

评论
1
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务