直接利用窗口函数解决!
求累计和/汇总 语句结构:SUM( 列名 )OVER( ORDER BY 列名)
select a.emp_no,a.salary, sum(a.salary) over(order by a.emp_no) as running_total from salaries a where a.to_date = '9999-01-01';
直接利用窗口函数解决!
求累计和/汇总 语句结构:SUM( 列名 )OVER( ORDER BY 列名)
select a.emp_no,a.salary, sum(a.salary) over(order by a.emp_no) as running_total from salaries a where a.to_date = '9999-01-01';