Re: Can anyone explain the logic in this for me??
Date: Sat, 02 Mar 2002 06:26:20 GMT
Message-ID: <gg_f8.47552$766.1666512_at_news-binary.blueyonder.co.uk>
NULL represents an unknown value. Although Oracle allows the use of relational operators (=, !=, and so on) with NULL, this type of comparison will not return meaningful results. For example
SELECT 'X' FROM DUAL WHERE NULL = NULL will not select anything. Always use IS or IS NOT for comparing values to NULL BW
"J.P." <jp_boileau_at_yahoo.com> wrote in message
news:7e388bc3.0203011219.9e6e569_at_posting.google.com...
> Now this is a bit puzzling...
>
> 1* SELECT 'X' FROM DUAL WHERE '' = NULL
> SQL> /
>
> no rows selected
>
> Elapsed: 00:00:00.00
> SQL> SELECT 'X' FROM DUAL WHERE '' IS NULL
> 2 /
>
> '
> -
> X
>
>
> Now why is the empty string ( '' ) <> null but the same empty string IS
NULL ?
>
> JP
Received on Sat Mar 02 2002 - 07:26:20 CET