nvl function not returning when group by used
635179Apr 29 2008 — edited Apr 29 2008Hi
I'm a bit confused as to why this will return 0 if sales are null
---------------------------------------------------------------------
SELECT NVL(SUM(SALES)), 0) , COUNT(sale_id) FROM table 1 where date=5201.
---------------------------------------------------------------------
but when i use a group by, the nvl function doesn't work i.e. returns nothing
-------------------------------------------------------------------------
SELECT NVL(SUM(SALES)), 0) , COUNT(sale_id) FROM table 1 where date=5201 group by supplier
-----------------------------------------------------------------------
Your help is appreciated.
David