方法一: select b.emp_no, b.salary, (select sum(a.salary) running_total from salaries a where a.emp_no<=b.emp_no and a.to_date = '9999-01-01' ) from salaries b where b.to_date = '9999-01-01' 本题可使用子查询,通过where ...