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

From: vc <boston103_at_hotmail.com>
Date: 28 Nov 2005 18:52:57 -0800
Message-ID: <1133232777.740200.225290_at_g14g2000cwa.googlegroups.com>


michael_at_preece.net wrote:
> vc wrote:

[...]
> > > If we assume that it is not generally the case that two people with
> > > NULLs for their countries (speaking loosely here) live in the same
> > > country, the query would simply have to be written so as to disregard
> > > people with NULL country.
> >
> > 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.

Whether or not two values are considered distinct is irrelevant to the null = null comparison. The fact that two nulls are not distinct does not imply that they are equal. If you'd care to read the entire standard, you'd discover that:

"
<comp op> ::=

                <equals operator>
              | <not equals operator>
              | <less than operator>
              | <greater than operator>
              | <less than or equals operator>
              | <greater than or equals operator>
[...]

Let XV and YV be the values represented by X and Y,

            respectively.

            Case:

  1. If XV or YV is the null value, then "X <comp op> Y" is unknown. "

... as required by the 3VL. Received on Tue Nov 29 2005 - 03:52:57 CET

Original text of this message