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

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

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

select 在职表的.emp_no,(在职表的.salary-入职表的.salary) growth from 

(   select t1.emp_no,t2.salary from employees t1
    join salaries t2 on t1.emp_no = t2.emp_no
    where t1.hire_date >= t2.from_date
) 入职表的

join 

(   select t1.emp_no,t2.salary from employees t1
    join salaries t2 on t1.emp_no = t2.emp_no
    where t2.to_date = '9999-01-01'
) 在职表的

on 入职表的.emp_no = 在职表的.emp_no
order by growth

简单粗暴

全部评论

相关推荐

04-19 10:50
门头沟学院 Java
想奋斗的小山竹在改简...:学院本能过简历筛选吗,我怎么看一些一本都过不了
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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