Hi,
The SQL standard requires that null values do not equate any value,
including themselves.
Corrected syntax of your queries is shown below.
If I recall it correctly, this nehaviour was enforced in the 7.2->7.3 or
7.1->7.2 evolution.
If for instance a char(1) field called 'myfield' admits several values
rangeing from 'A' to 'I' and null, extracting all rows where char is neither
'C' or 'F' should imply the following where-clause
... where myfield is null or myfield is not in ('C','F')
A cluase like "where myfield is not in ('C','F')" would not extract all rows
where myfield is null.
Hope this helps
Regards
J6M
----- Original Message -----
From: "BogDan Vatra" <bog_dan_ro@yahoo.com>
To: <pgsql-bugs@postgresql.org>
Sent: Thursday, September 29, 2005 10:38 AM
Subject: [BUGS] BUG #1921: NULL<>NULL ?!?!?!?!?!?!?
>
>
> create table test (id serial, tt varchar(50));
> insert into test (tt) values(NULL);
> select tt from test where tt=NULL;
select tt from test where tt is null ;
>
> select tt from test where tt<>NULL;
select tt from test where tt is not null ;