select id, grp_factor, sum (id) over( partition by grp_factor order by id rows between unbounded preceding and current row ) running_sum from NUMBERS where ID <1000;连续聚合在财务报表中应该再常见不过了。