题解 | #SQL21 查找在职员工自入职以来的薪水涨幅情况#
查找在职员工自入职以来的薪水涨幅情况
http://www.nowcoder.com/practice/fc7344ece7294b9e98401826b94c6ea5
select t1.emp_no, t2.salary - t1.salary growth from (select e.emp_no, s.salary from employees e left join salaries s on e.hire_date = s.from_date) t1 inner join (select s.emp_no, s.salary from salaries s where s.to_date = '9999-01-01') t2 on t1.emp_no = t2.emp_no order by growth