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

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

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

1.找到最后的薪资 2.找到入职时的工资 3.求差

select q1.emp_no, q1.salary - min as growth from (select emp_no, salary from salaries where to_date = '9999-01-01') q1

join

(select t1.emp_no, t1.salary as min from ( select * from salaries where emp_no in (select emp_no from salaries where to_date ='9999-01-01')) t1 join ( select emp_no,min(from_date) as mindate from salaries group by emp_no) t2 on t1.emp_no = t2.emp_no where t1.from_date = t2.mindate) q2 on q1.emp_no = q2.emp_no order by growth

全部评论

相关推荐

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

创作者周榜

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