Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Reply to Grouping NULL values
> Does anyone have any nifty work arounds for grouping null values?
>
> ex/
> Select nvl(column1, 0), count(column1) from table1
> group by column1;
Don't count column values ( count(column1) ) since null is not a value, just count rows within the column1 group ( count(*) ).
>
> 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 |
> |===========================================================|
John Griffin (205) 890-2401 | A TTTTTTT SSSSS Advanced Technology Systems (ATS), Inc. | A A T S 4801 University Square, Suite 2 | AaaaA T SSSSS Huntsville, AL 35816-3431 | A A T S johng_at_rmf41.usace.army.mil | A A T SSSSS ---------------------------------------------------------------------------Received on Tue Jan 02 1996 - 15:50:29 CST
![]() |
![]() |