nikolas916
IS-IT--Management
I'm using MS Query, and want to display all rows of a certain column even if the other columns associated with it are Null. For example...
SELECT SO_LN.MINOR_CD,
SUM(DECODE(ORD_TP_CD,'CRM',-QTY,'SAL',QTY,0)),
SUM(DECODE(ORD_TP_CD,'CRM',-QTY,'MCR',-QTY,QTY)*UNIT_PRC),
FROM SALES.SO SO, SALES.SO_LN SO_LN
WHERE SO.DEL_DOC_NUM = SO_LN.DEL_DOC_NUM
GROUP BY SO_LN.MINOR_CD
I want it to show sales by minor code even if no sales were done in a particular minor code. I want to just show zeros. I've tried using nvl(x,0) with no success. Anyone have any suggestions?
SELECT SO_LN.MINOR_CD,
SUM(DECODE(ORD_TP_CD,'CRM',-QTY,'SAL',QTY,0)),
SUM(DECODE(ORD_TP_CD,'CRM',-QTY,'MCR',-QTY,QTY)*UNIT_PRC),
FROM SALES.SO SO, SALES.SO_LN SO_LN
WHERE SO.DEL_DOC_NUM = SO_LN.DEL_DOC_NUM
GROUP BY SO_LN.MINOR_CD
I want it to show sales by minor code even if no sales were done in a particular minor code. I want to just show zeros. I've tried using nvl(x,0) with no success. Anyone have any suggestions?