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

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

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


# # 入职的薪水表
with a as
(SELECT e.emp_no,s.salary as first_salary
from employees e 
left join salaries s on e.emp_no = s.emp_no
where e.hire_date = s.from_date )

select num,(now_salary - first_salary) as growth 
from 
(select* from a
 LEFT JOIN
 (SELECT e.emp_no as num,s.salary as now_salary
  from employees e 
  left join salaries s on e.emp_no = s.emp_no
  where s.to_date = '9999-01-01')b
 on a.emp_no = b.num
)c
where  num is not null 
and (now_salary - first_salary) is not NULL
order by growth
全部评论

相关推荐

不愿透露姓名的神秘牛友
07-04 14:35
点赞 评论 收藏
分享
湫湫湫不会java:先投着吧,大概率找不到实习,没实习的时候再加个项目,然后把个人评价和荣誉奖项删了,赶紧成为八股战神吧,没实习没学历,秋招机会估计不多,把握机会。或者说秋招时间去冲实习,春招冲offer,但是压力会比较大
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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