如何将SUM(FAMOUNT_BASE)与SUM(FDISCRATE) 的差值,写进下面的语句 ? select SUM(FAMOUNT_BASE),SUM(FDISCRATE) FROM ( SELECT MA.FCODE,MA.FAMOUNT_BASE,DE.FDISCRATE FROM BS_MV_SA_MA MA INNER JOIN BS_MV_SA_DE DE ON MA.FMID=DE.FPID WHERE TO_CHAR(MA.FBIZTIME,'YYYYMMDD')= TO_CHAR(sysdate,'YYYYMMDD')-1 AND MA.FSTATE=6 AND MA.FORG_STORE_CODE NOT LIKE 'S%' UNION ALL SELECT MA.FCODE,MA.FAMOUNT_BASE,DE.FDISCRATE FROM BS_MV_SA_MA MA INNER JOIN BS_MV_SA_DE DE ON MA.FMID=DE.FPID WHERE TO_CHAR(MA.FBIZTIME,'YYYYMMDD')= TO_CHAR(sysdate,'YYYYMMDD')-1 AND MA.FSTATE=6 AND MA.FORG_STORE_DE_CODE NOT LIKE 'S%' ) |
最佳回答 |
||||
0
|
|