select a.emp_no,(c.salary-b.salary) as growth from employees a left join salaries b on a.emp_no=b.emp_no and a.hire_date =b.from_date #入职薪资 left join salaries c on a.emp_no=c.emp_no and c.to_date='9999-01-01' #在职有效期薪资 where c.emp_no is not null order by growth;