此题的解题关键在于,找到每个员工的入职时间。一种思路是使用关联子查询。代码如下:

select emp_no, salary
from salaries s1
where from_date <= all(select from_date
                       from salaries s2
                       where s2.emp_no = s1.emp_no)
order by emp_no desc;