rojer-di
查找所有员工自入职以来的薪水涨幅情况
http://www.nowcoder.com/questionTerminal/fc7344ece7294b9e98401826b94c6ea5
select e.emp_no, (s1.salary-s2.salary) as growth /*两份salaries表, 用作查询当前薪水和初始薪水*/ from salaries as s1, salaries as s2, employees as e /*当前薪水*/ where s1.to_date = '9999-01-01' /*初始薪水*/ and s2.from_date = e.hire_date /*保证是同一个人*/ and s1.emp_no = s2.emp_no /*按人分组*/ group by e.emp_no /*按growth升序*/ order by growth;