在 SAP 中对临时列中的列执行总计
您需要对查询再次执行选择。这是示例
SELECT DATE, FUND_ID, PPT_ID, SOURCE_ID, AMOUNT, SUM (AMOUNT) as TOTAL FROM ( SELECT AD.CHV_DATE.DATE, AD.CHV_FUND.FUND_ID, AD.CHV_PARTICT.PPT_ID, AD.CHV_PARTICT.SOURCE_ID, SUM (AD.CHV_PARTICT.AMOUNT), FROM AD.CHV_DATE, AD.CHV_FUND, AD.CHV_PARTICT, AD.CHV_SOURCE WHERE DC.CHV_SOURCE.FUND_ID=AD.CHV_FUND.FUND_ID AND (DC.CHV_SOURCE.DATE=AD.CHV_DATE.DATE) AND (DC.CHV_PARTICT.PPT_ID=AD.CHV_SOURCE.PPT_ID) AND ( AD.CHV_DATE.DATE IN ('2017-08-02') AND AD.CHV_PARTICT.PPT_ID IN ('PPT0449') ) GROUP BY AD.CHV_DATE.DATE, AD.CHV_FUND.FUND_ID, AD.CHV_PARTICT.PPT_ID, AD.CHV_SOURCE.SOURCE_ID) GROUP by DATE, FUND_ID, PPT_ID, SOURCE_ID, AMOUNT