在职: 规定 to_date = '9999-01-01'
入职:对照员工表的 hire_date
涨幅:最近一次 - 入职时的薪水

select es.emp_no, (ss2.sl2-ss.salary) as growth from employees es 
left join salaries ss on es.emp_no = ss.emp_no and es.hire_date = ss.from_date
join (select emp_no, salary sl2 from salaries where to_date = '9999-01-01') ss2 
on es.emp_no = ss2.emp_no
order by growth