Re: peeve
Posted in 1993
In article <1sopovINNc9h@emory.mathcs.emory.edu> jparker@hpbs2561.boi.hp.com (Jack Parker) writes:
>I hate fixing a statement from:
>
>IF a != b THEN .....
>
>TO
>
>IF a != b
>OR (a IS NULL AND b IS NOT NULL)
>OR (a IS NOT NULL AND b IS NULL ) THEN .....
So would I. That's why I do this instead:
IF A = B
THEN -- nothing
ELSE ...
END IF
>Why is it that NULL is NOT EQUAL to "xxx", but it is not NOT EQUAL to "xxx"
>either?
Because NULL means UNKNOWN. Therefore, UNKNOWN *could* equal "xxx".
Just like if you say:
SELECT * FROM table WHERE col1 = "value"
UNION
SELECT * FROM table WHERE col1 != "value"
will *not* pick up those rows where col1 is NULL.
>I'm not looking for the real answer, I'm looking for the explanation
>of why grunts like me have to deal with this when it's 'intuitively obvious
>to the most casual observer' that NULL should not not NOT EQUAL "xxx".
It's 'intuitively obvious to the most casual observer' that the Earth's
surface is flat, too.
Remember the key meaning of NULL: *UNKNOWN*.
>Even better, when is it going to be fixed?
It ain't broke.
>Jack Parker - Contractor
--
Alan Denney aland@informix.com {pyramid|uunet}!infmx!aland
Disclaimer: These opinions are mine alone. If I am caught or killed,
the secretary will disavow any knowledge of my actions.
"If you don't know why you want NT, you probably don't want NT."
-- Bill Gates