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

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

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

## 2.用现在的薪水减去入职时薪水,获取薪资涨幅
select t3.emp_no,t3.salary - t4.salary as growth from salaries t3
join (
    ## 1.查询出入职时的薪水
    select t1.emp_no,t1.salary from salaries t1
    join employees t2
    on t2.hire_date = t1.from_date
)t4 on t3.emp_no=t4.emp_no
where t3.to_date='9999-01-01'
order by growth;

还有降薪啊

全部评论

相关推荐

自由水:笑死了,敢这么面试不敢让别人说
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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