Re: So what's null then if it's not nothing?

From: Jon Heggland <heggland_at_idi.ntnu.no>
Date: Tue, 29 Nov 2005 09:27:13 +0100
Message-ID: <MPG.1df62f4aaf5e4cb8989712_at_news.ntnu.no>


In article <1133232777.740200.225290_at_g14g2000cwa.googlegroups.com>, boston103_at_hotmail.com says...
>
> michael_at_preece.net wrote:
> > vc wrote:
> [...]
> > > So you insist that the valuation of "null=null" as true can make sense
> > > in some cases ? If so, what are those cases ?
> >
> > "X3H2-92-154/DBL CBR-002
> > 3.1 Definitions
> >
> > h) distinct: Two values are said to be not distinct if either:
> > both are the null value, or they compare equal according to
> > Subclause 8.2, "<comparison predicate>". Otherwise they are
> > distinct. Two rows (or partial rows) are distinct if at
> > least
> > one of their pairs of respective values is distinct.
> > Otherwise
> > they are not distinct. The result of evaluating whether or
> > not
> > two values or two rows are distinct is never unknown."
> >
> You are confused, amigo.

SQL is confused, and breeds confusion. For one thing, NULL is not a value. If it were, it would be equal to itself.

> Whether or not two values are considered distinct is irrelevant to the
> null = null comparison.

By SQL fiat, perhaps. But *should* it be? What gives SQL the right to redefine notions of equality and "distinctness" in this manner? Or never mind the right; does it make *sense*? Is it worth the price?

By the way, is NULL = NULL a valid SQL expression now?

-- 
Jon
Received on Tue Nov 29 2005 - 09:27:13 CET

Original text of this message