Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: NVL statement?
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