SELECT SUM(pcsl) FROM PMCTABLE a where a.pcrq<=PMCTABLE.pcrq and a.dddh=PMCTABLE.dddh and a.cpph=PMCTABLE.cpph)
https://blog.csdn.net/u012324101/article/details/80251003
参考https://blog.csdn.net/iteye_15971/article/details/82681696?spm=1001.2101.3001.6661.1&utm_medium=distribute.pc_relevant_t0.none-task-blog-2%7Edefault%7ECTRLIST%7ERate-1.pc_relevant_paycolumn_v3&depth_1-utm_source=distribute.pc_relevant_t0.none-task-blog-2%7Edefault%7ECTRLIST%7ERate-1.pc_relevant_paycolumn_v3&utm_relevant_index=1
用 over 开窗函数, 其他正常些写,就是 sum后面加上 over (order by 日期)
https://help.finereport.com/finereport9.0/doc-view-1960.html