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

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

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

select tt.dept_no,tt.emp_no,tt.salary from 
(select d.dept_no,d.emp_no,s.salary,
dense_rank() over (partition by d.dept_no order by s.salary desc) as rank
from dept_emp as d join salaries as s 
on d.emp_no=s.emp_no
and s.to_date='9999-01-01'
and d.to_date='9999-01-01') as tt
where tt.rank=1
order by tt.dept_no
全部评论

相关推荐

06-11 17:39
门头沟学院 Java
小呆呆的大鼻涕:卧槽,用户彻底怒了
点赞 评论 收藏
分享
评论
2
收藏
分享

创作者周榜

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