Re: Is NULL equal to NULL or not? - Mailing list pgsql-general

From Rich Shepard
Subject Re: Is NULL equal to NULL or not?
Date
Msg-id Pine.LNX.4.44.0212091516430.31345-100000@appl-ecosys.com
Whole thread Raw
In response to Re: Is NULL equal to NULL or not?  ("scott.marlowe" <scott.marlowe@ihs.com>)
List pgsql-general
On Mon, 9 Dec 2002, scott.marlowe wrote:

> > I've noticed that
> >         select NULL=NULL;
> > yields TRUE. It is also possible to select rows in this manner.
>
> That's NOT because null EQUALS null, but because it allowed you to assign
> one null value to another.  which technically can be done, so it came out
> true.

  This is a common misuderstanding. NULL means indeterminant, not zero or
missing. Since NULL is and unknown value there's no way to compare it with
another unknown value. You are absolutely correct in that the syntax 'are
both values unknown' equates to NULL is NULL while there is no meaning to
NULL=NULL.

Rich

Dr. Richard B. Shepard, President

                       Applied Ecosystem Services, Inc. (TM)
            2404 SW 22nd Street | Troutdale, OR 97060-1247 | U.S.A.
 + 1 503-667-4517 (voice) | + 1 503-667-8863 (fax) | rshepard@appl-ecosys.com
                         http://www.appl-ecosys.com/


pgsql-general by date:

Previous
From: Mike Mascari
Date:
Subject: Re: Is NULL equal to NULL or not?
Next
From: "Robert Fitzpatrick"
Date:
Subject: Re: Field sizes and structure