知识点

  1. 涨幅情况计算思路就是要生成两个表一个现在薪水表、一个入职薪水表
  2. 连续内连接and不能换成where

代码

select e.emp_no, (s1.salary-s2.salary) growth
from employees e
inner join salaries s1
on e.emp_no=s1.emp_no 
and s1.to_date='9999-01-01'
inner join salaries s2
on e.emp_no=s2.emp_no 
and s2.from_date=e.hire_date
order by growth