Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: oracle sum display zero instead of NULL
trpost_at_gmail.com wrote:
> I have a simple query:
>
> SELECT SUM(cases_escalated) AS casesescalated FROM groupsummary WHERE
> report_date=TO_DATE('Sep 2007','MON YYYY') AND group_name = 'T1';
>
> The query works fine, except for when there is nothing to SUM and then
> I get returned NULL instead of 0.
>
> My question is how can I get the query to display 0 instead of
> 'blank'; I read something about using a join, but I don't see how
> joining would help me as right now this is the only table in my
> database. Would I somehow join against a query to DUAL?
>
NVL(caes_escalated, 0)
-- Daniel A. Morgan University of Washington damorgan_at_x.washington.edu (replace x with u to respond) Puget Sound Oracle Users Group www.psoug.orgReceived on Thu Nov 01 2007 - 18:21:44 CDT
![]() |
![]() |