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

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

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

select 
h.dept_no,
h.emp_no,
h.salary
from
(select
d.dept_no,
d.emp_no,
s.salary,
dense_rank() over(partition by d.dept_no order by salary desc) as rnk 
from
salaries s,
dept_emp d
where
d.emp_no = s.emp_no) as h
where
rnk = 1
order by h.dept_no asc

全部评论

相关推荐

10-31 22:23
门头沟学院 Java
天然不是卷王:太好了 佬的金九银十结束,等offer吐出来,我的金11银12就要开始了
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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