Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: How to select 0 as null
nvl(value,0) --- returns 0 when value is null otherwise value
decode(value,0,null,value) - returns null when value 0 otherswise value
Kim Bundgaard wrote in message
<01bed518$8e162560$4c1414ac_at_h-11361.kmd.dk>...
>I'm not so familar with Oracle - so excuse for a potentially "not so
>intelligent" question.
>
>How do I select a zero value as null, and all other values with is correct
>value. I want my resultset to have null instead of zero for the row where
>my column value is zero, and all other value should have their correct
>value (ie. 10, 125 and so on).
>
>I can do it with som combination of union all and where clause, but that
>seems a little bit nasty.
>
>Any suggestion would be appreciated.
>
>/Kim Bundgaard
Received on Fri Jul 23 1999 - 09:43:52 CDT
![]() |
![]() |