最近遇到一个需求,需要实现当年每个月数据累加
SELECT XALISEDATA xAliseData, SERIESDATA seriesData FROM (SELECT SERIESDATA, XALISEDATA, ROW_NUMBER() OVER(ORDER BY XALISEDATA) RK FROM ( SELECT CASE WHEN double(IMPORTED_MONTH)=0.0 THEN 0 ELSE double(IMPORTED_MONTH)/10000 END AS seriesData,TAX_YEAR||TAX_MONTH AS xAliseData from APPINST.HGXX where 1=1 AND ENTERPRISE_NAME = '浙江进出口有限公司' AND TAX_YEAR = '2018' order by TAX_YEAR||TAX_MONTH DESC ) ) order by XALISEDATA
效果图,如下:
以上仅供参考