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: NVL statement?

Re: NVL statement?

From: Arjan van Bentem <avbentem_at_DONT-YOU-DAREdds.nl>
Date: Fri, 11 Dec 1998 21:35:52 +0100
Message-ID: <74rvn7$lds$1@newton.a2000.nl>


suisum wrote
>Will this statement:
> NVL(bill_no, 0) != 0
>equals to this statement:
> bill_no <> 0 AND bill_no IS NOT NULL

Yes. If bill_no is null, then the nvl returns zero. In fact, your statement equals

    ( (bill_no is not null) and (bill_no != 0) )     or ( (bill_no is null) and (0 != 0) )

The last line always yields false, as (0 != 0) is always false and (<anything> and false) yields false. So, omitting the last line, all you have is

    (bill_no is not null) and (bill_no != 0)

However, to get this, you do not need the nvl(..) function. Simply

    bill_no != 0

will do the same thing as null never equals zero...

Arjan. Received on Fri Dec 11 1998 - 14:35:52 CST

Original text of this message

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