题解 | #查找在职员工自入职以来的薪水涨幅情况#

查找在职员工自入职以来的薪水涨幅情况

https://www.nowcoder.com/practice/fc7344ece7294b9e98401826b94c6ea5

select
    t4.emp_no,
    (t4.salary - t3.salary) as growth
from
    (
        select
            t1.emp_no,
            t2.salary
        from
            employees as t1
            join salaries as t2
        where
            t1.hire_date = t2.from_date
    ) as t3
    join (
        select
            emp_no,
            salary
        from
            salaries
        where
            to_date = '9999-01-01'
    ) as t4 on t3.emp_no = t4.emp_no
order by growth asc;

全部评论

相关推荐

挣K存W养DOG:他真的很中意你,为什么不回他
点赞 评论 收藏
分享
点赞 收藏 评论
分享
牛客网
牛客企业服务