题解 | #统计出当前各个title类型对应的员工当前薪水对应的平均工资#
查找在职员工自入职以来的薪水涨幅情况
http://www.nowcoder.com/practice/fc7344ece7294b9e98401826b94c6ea5
单表自连接,没啥思路,就恩做,表1也没用到.我是不是很呆
select s1.emp_no,sum(s2.salary-s1.salary) as growth from salaries s1 join salaries s2 on s1.to_date= s2.from_date group by s1.emp_no having s1.emp_no in ( select emp_no from salaries where to_date='9999-01-01') order by growth