select v1,v2,sum(v2) over(partition by v1 order by v2) as sum 参考链接:https://blog.csdn.net/wawmg/article/details/40840093