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;
连续聚合在财务报表中应该再常见不过了。
2022-11-23 07:22:31
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;
连续聚合在财务报表中应该再常见不过了。