题解 | #统计salary的累计和#
统计salary的累计和running_total
https://www.nowcoder.com/practice/58824cd644ea47d7b2b670c506a159a6
SELECT emp_no, salary, SUM(salary) OVER(ORDER BY emp_no) running_total FROM salaries WHERE to_date = '9999-01-01'
典型的累计和开窗函数题。对薪资进行SUM,对员工号进行排序