题解 | #查找在职员工自入职以来的薪水涨幅情况#
查找在职员工自入职以来的薪水涨幅情况
http://www.nowcoder.com/practice/fc7344ece7294b9e98401826b94c6ea5
SELECT N.e_now,(N.s_now-H.s_hire) growth
FROM
(SELECT e.emp_no,s.salary s_hire
FROM employees e INNER JOIN salaries s ON e.emp_no=s.emp_no
WHERE s.from_date=e.hire_date) H ,
(SELECT emp_no e_now, salary s_now FROM salaries
WHERE to_date="9999-01-01") N
WHERE N.e_now=H.emp_no
ORDER BY growth;
题解-SQL 文章被收录于专栏
SQL刷题