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

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

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
全部评论

相关推荐

03-13 16:51
已编辑
门头沟学院 硬件开发
点赞 评论 收藏
分享
xxxxOxo:该催就催,想要你的不会因为催就挂,催了就挂的是因为本来就要挂你
点赞 评论 收藏
分享
评论
1
收藏
分享

创作者周榜

更多
牛客网
牛客企业服务