Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: Grouping NULL values

Re: Grouping NULL values

From: Dirk Burghall <dfburghall_at_UCDAVIS.EDU>
Date: Tue, 2 Jan 1996 12:28:14 -0800
Message-Id: <9601022047.AA28000@alice.jcc.com>


Robert,

Try count(nvl(column1, 0)) instead of count(column1)...

Dirk...


>Does anyone have any nifty work arounds for grouping null values?
>
>ex/
> Select nvl(column1, 0), count(column1) from table1
> group by column1;
>
>If the values in the database are 1,2,3 and NULL it returns
>
>column1 Count(column1)
>------- --------------
>1 7
>3 4
>3 12
>0 0 I know there are null values in the table....
>
>Thanks in advance....
>------
>Robert
>
>
>|===========================================================|
>| Robert Sisk Phone: (803) 935-8136 |
>| SCT Utility Systems Email: rsisk_at_sctcorp.com |
>|===========================================================|
>
>


Dirk Burghall                           e-mail: dfburghall_at_ucdavis.edu
University Services Bldg Rm 254
University of California, Davis         voice:    (916) 757-8917
Davis, CA 95616-8505                    fax:      (916) 757-8778
--------------------------------------------------------------------------

Received on Tue Jan 02 1996 - 15:48:12 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US