题解 | #查找在职员工自入职以来的薪水涨幅情况#
查找在职员工自入职以来的薪水涨幅情况
http://www.nowcoder.com/practice/fc7344ece7294b9e98401826b94c6ea5
select emp_no,max(growth) as growth from (select emp_no,salary,max_salary-salary as growth from (select a.emp_no,a.salary,b.max_salary from salaries as a left join (select emp_no,salary as max_salary from salaries where to_date='9999-01-01') as b on a.emp_no=b.emp_no where max_salary is not null) as c) as d group by emp_no order by growth 层层剥削