select a.emp_no, (select salary from salaries s where a.emp_no=s.emp_no and s.to_date=(select max(to_date) from salaries t where s.emp_no=t.emp_no group by t.emp_no)) -(select salary from salaries s where a.emp_no=s.emp_no and s.from_date=(select min(from_date) from salaries t where s.emp_no=t.emp_no group by t.emp_no)) as growth from salaries a where a.to_date = '9999-01-01' order by growth asc一步到位,结构比较简单,但是嵌套了两层子查询,可能不是很好理解,但理清楚关系后还是挺简单的