题解 | #查找在职员工自入职以来的薪水涨幅情况#
查找在职员工自入职以来的薪水涨幅情况
http://www.nowcoder.com/practice/fc7344ece7294b9e98401826b94c6ea5
select e.emp_no, (s1.salary -s2.salary) growth from employees e inner join salaries s1 on e.emp_no = s1.emp_no and to_date = '9999-01-01' -- 在职薪资 inner join salaries s2 on e.hire_date = s2.from_date -- 入职薪资(录用时间=入职时间) order by growth