第一步:

#查找入职时的薪水
select s.emp_no,salary as 入职薪水
from salaries as s,employees as e
where s.from_date = e.hire_date;

第二步

#查找当前的薪水
select emp_no,salary as 当前薪水 from salaries
where to_date='9999-01-01';

最后:

#当前-入职为薪水涨幅
select t1.emp_no,当前薪水-入职薪水 as growth
from
    (select s.emp_no,salary as 入职薪水
    from salaries as s,employees as e
    where salaries.from_date = employees.hire_date) as t1
join
    (select emp_no,salary as 当前薪水
    from salaries
    where to_date='9999-01-01') as t2
on t1.emp_no=t2.emp_no
order by growth;