SELECT
SUM(A.ZIFXAV015) AS SR
,SUM(A.ZIFXAC016) AS CB
,A.PROFIT_CTR AS BM
,A.CALMONTH AS NY
FROM "_SYS_BIC"."CB.AL.YW/ZAL_SALES_DETAIL" A
LEFT JOIN "_SYS_BIC"."CB.BL.YW/ZBL_ZDEFI002" B
ON A.PROFIT_CTR = B.PROFIT_CTR AND A.CALMONTH = B.CALMONTH
WHERE FISCPER NOT LIKE '%000' AND A.PROFIT_CTR='P8001'
GROUP BY
A.PROFIT_CTR,A.CALMONTH
上面的sql你试试,group by 最好别加除BM 和NY多余的字段的了,不然会影响分组,还有你上面group by 里的A.ZIFXAV015和A.ZIFXAC016这两个千万不能加的,这个是汇总字段,汇总字段是不会出现在group by后面的,不然就不会汇总了