Re: IS (NULL = 1) equal to NOT(NULL = 1)?

From: Alexander Moan <moan_at_sn.no>
Date: 1996/08/22
Message-ID: <4vg8ac$6a0_at_hasle.sn.no>#1/1


In the article <321B7C7E.41C67EA6_at_unm.edu>, Guy Bassan <gbassan_at_unm.edu> wrote :
> According to Oracle's documentation (which is occasionally correct),
> whenever you use NULL in any kind of function, you almost always get
> NULL back. (NULL = 1) is a function that returns a boolean: TRUE,
> FALSE or NULL. Usually booleans only have two values, but Oracle isn't
> constrained by silly conventions like that.
>
> Now, since (NULL = 1) is sort of like a function using NULL, the boolean
> value returned is NULL. Similarly, when you take not(NULL), you are
> again using a function on NULL, and NULL is again returned. Thus, both
> times you are doing IF (NULL), and since NULL is not TRUE, the program
> runs the ELSE condition both times.
>
> To summarize: Yes, (NULL = 1) is equal to NOT(NULL = 1)

Well..Yes..and No
NULL is per definition undefined !
Comparing NULL to anything is therfore meaningless even if (NULL=1) = NULL and NOT(NULL=1) = NULL.
A comparison with NULL will always return NULL ! That's why we have the IS NULL consept.

:)

--
----------------------------------------------------------
| Alexander Moan	 --:-)		      moan_at_sn.no |
| Any statements I make are my own, and are not to be    |
| taken as an statement from my employer.                |
|                                                        |
| Norwgian Defence Command Norway			 |
| Home Guard Staff					 |
|							 |
| "Don't blame me, I just work here !"			 |
---------------------------------------------------------
Received on Thu Aug 22 1996 - 00:00:00 CEST

Original text of this message