题解 | #查找在职员工自入职以来的薪水涨幅情况#
查找在职员工自入职以来的薪水涨幅情况
https://www.nowcoder.com/practice/fc7344ece7294b9e98401826b94c6ea5
题目要求在职员工的薪资涨幅,那么薪资表内的信息已经足够 找到结束日期为9999-01-01的记录,即为在职员工,只要用窗口函数拿到入职工资,相减即可 select emp_no, salary - start_salary growth from ( select emp_no, to_date, salary, first_value(salary) over(partition by emp_no order by to_date) start_salary from salaries --获取最终工资和初始工资 ) a where to_date = '9999-01-01' order by growth