select occur_period ,area_code ,index_code ,r ,gxl ,sum(gxl) over(order by r asc rows between unbounded preceding and current row ) as gxl_lj from tabl01
参考博客
https://segmentfault.com/a/1190000039083467