Re: comparing rows - Mailing list pgsql-hackers

From Don Baccus
Subject Re: comparing rows
Date
Msg-id 3.0.1.32.20000803065253.014e3650@mail.pacifier.com
Whole thread Raw
In response to Re: comparing rows  (Thomas Lockhart <lockhart@alumni.caltech.edu>)
Responses Re: comparing rows
Re: comparing rows
List pgsql-hackers
At 01:44 PM 8/3/00 +0000, Thomas Lockhart wrote:
>> Not compatible with the current release of MS SQL/MSDE :-) At least not
>> fully.
>
>The original issue was that "foo = NULL" is *not* a legal SQL92
>statement. 

Ummm...I think this is wrong, and I have Date on my side (I just
checked).  foo = NULL is NULL, just like foo + NULL is NULL.

If foo = NULL is illegal, doesn't this make it rather difficult to
say things like table1.i = table2.i for tables that contain NULLs
in column i?

Oracle allows it, and returns NULL.  Oracle's fairly trustworthy
on low-level standards compliance over things like NULL (not
entirely, though - it treats '' as NULL in the VALUES list of
an INSERT, though not elsewhere, for instance).

NULL = NULL is also perfectly legal, returning NULL.  Before one
gets too excited, NULL <> NULL and NULL < NULL etc all return
NULL, too, along with NULL = <anything> so it's not terribly
useful, which is why IS NULL exists.



- Don Baccus, Portland OR <dhogaza@pacifier.com> Nature photos, on-line guides, Pacific Northwest Rare Bird Alert
Serviceand other goodies at http://donb.photo.net.
 


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: comparing rows
Next
From: Don Baccus
Date:
Subject: RE: comparing rows