












sql 逐行累加,包括当前行
select name,sl, sum(sl) over(partition by name order by name rows between unbounded preceding and current row) as accumulate from test;

可以实现在窗口中进行逐行累加
select uid,month,amount,
sum(amount) over(partition by uid order by month rows between unbounded preceding and current row) as accumulate
from t_access_tmp;
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。