题解 | #统计salary的累计和running_total#
统计salary的累计和running_total
http://www.nowcoder.com/practice/58824cd644ea47d7b2b670c506a159a6
select s1.emp_no,s1.salary,sum(s2.salary) running_total
from salaries s1
join salaries s2
on s1.emp_no >= s2.emp_no
where s1.to_date = '9999-01-01' and s2.to_date = '9999-01-01'
group by s1.emp_no
order by s1.emp_no;