Re: (null) != (null) ?

From: Thomas Pfau <pfau(at)maherterminals(dot)com>
To: pgsql-bugs(at)postgreSQL(dot)org
Subject: Re: (null) != (null) ?
Date: 1999-10-26 12:57:06
Message-ID: 3815A522.FE65AA3A@maherterminals.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Todd Vierling wrote:
> (1) SELECT ... FROM table1 a,table2 b WHERE a.fieldname = b.fieldname;
>
> Both "fieldname" definitions are identical (verified with char(2) and
> varchar(100) in particular), and both tables contain a row with a "null" in
> that field. However, the results don't contain the row with the "null"
> value. A quick reproduction:

This is standard SQL behavior. NULL != NULL. Essentially, NULL is an
undefined value. Since it is undefined, it can't be know to be equal to
anything, even another undefined value.

Oracle has the NVL function which can be used to replace nulls with
known values allowing your statement above to work as you expect. I
don't think Postgres has a similar function but you could probably write
your own.

--
Thomas Pfau
pfau(at)maherterminals(dot)com
aka pfau(at)eclipse(dot)net
http://www.eclipse.net/~pfau/

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message secret 1999-10-26 13:21:28
Previous Message Ken Loomis 1999-10-26 12:29:07 Re: Pool Cues and Billiards Accessories 8096