一、问题
1. 单独使用窗口函数sum() over() 计算rows between 1 following and 3 following(假设当前行为x, 数据框应为[x+1, x+3])时,计算结果错误。
sum(value) over(partition by name order by sortcol rows between 1 following and 3 following) as way1
2. 前面加入rows between unbounded preceding and current row 时,way1指标计算才正确。
sum(value) over(partition by name order by sortcol) as way01 --有排序时,默认是 rows between unbounded preceding and current row
或者 rows between unbounded prece