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

Home -> Community -> Usenet -> c.d.o.misc -> Re: How to select 0 as null

Re: How to select 0 as null

From: Paul Q <paulq_at_home.com>
Date: Fri, 23 Jul 1999 14:43:52 GMT
Message-ID: <Ic%l3.5848$um6.57669@news2.rdc1.on.home.com>


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

Original text of this message

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