--代码中1=1是用来写你的过滤条件的
--代码中的表A,写你原来的表名
SELECT T3.MONTH, T3.CUST, T3.ITEM, NVL(T4.QTY, 0)
FROM (SELECT MONTH, CUST, ITEM
FROM (SELECT TO_CHAR(201600 + ROWNUM) AS MONTH
FROM DUAL
CONNECT BY ROWNUM <= 12) T1,
(SELECT CUST, ITEM FROM 表A WHERE 1 = 1 GROUP BY CUST, ITEM) T2) T3
LEFT JOIN
--T4这一段查询SQL也就是你提供的那段分组的查询,你可以自己调整
(SELECT Month, Cust, Item, SUM(QTY) AS QTY
FROM 表A
WHERE 1 = 1
GROUP BY Month, Cust, Item) T4
ON T3.MONTH = T4.MONTH
AND T3.CUST = T4.CUST
AND T3.ITEM = T4.ITEM
有问题可以追问,或者私聊