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

From: <banglea_at_onr.com>
Date: 1996/08/22
Message-ID: <4vh3ft$6j3_at_mari.onr.com>#1/1


Check the SQL Reference on IS NULL and IS NOT NULL comparison operator. There is also a discussion of using the "=" and the NOT "=" with NULL. I think this will answer your question.

In article <4vflmd$1fti_at_mule2.mindspring.com>, jtdennis_at_atl.mindspring.com says...
>
>
>Of course not right? Oracle says it is!
>
>I have the following *simple* code:
>
>set serveroutput on
>BEGIN
>DECLARE
>
>N NUMBER;
>
>BEGIN
>
>N := NULL;
>
>IF (N = 1)
>THEN
> dbms_output.put_line('TRUE');
>ELSE
> dbms_output.put_line('FALSE');
>END IF;
>
>/* Notice the expression has been "notted" */
>
>IF NOT(N = 1)
>THEN
> dbms_output.put_line('TRUE');
>ELSE
> dbms_output.put_line('FALSE');
>END IF;
>
>END;
>END;
>/
>
>This code returns:
>
>FALSE
>FALSE
>
>Now I've been doing this for a while. I know that 1 is not equal to
>NULL. I thought this meant (1 = NULL) = FALSE which might be true.
>However if it is true then certainly NOT(1 = NULL) would then be TRUE.
>NOT of *any* expression is the opposite boolean value. But not here.
>
>Anyway, if anyone could point out my error here please do so. I
>wouldn't even mind a little "... any rookie that knows anything know
>should know that null, etc..." stuff. Hmmm, well maybe not.
>
>Virtually,
>
>John Dennis
>
>
>
>
>
>
>
>
Received on Thu Aug 22 1996 - 00:00:00 CEST

Original text of this message