开窗函数 累加计算
unbounded:无界限
preceding:从分区第一行头开始,则为 unbounded。 N为:相对当前行向前的偏移量
following :与preceding相反,到该分区结束,则为 unbounded。N为:相对当前行向后的偏移量
current row:顾名思义,当前行,偏移量为0
例子:
partition by order by asc/desc rows between unbounded preceding and current row
partition by order by asc/desc rows between 1 preceding and 1 following
sum(sum(pur_comp_cnt)) over (partition by pur_id order by pur_comp_create_month rows between unbounded preceding and current row) pur_comp_cnt
本文来自博客园,作者:数据驱动,转载请注明原文链接:https://www.cnblogs.com/shun7man/p/15979786.html