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" <[EMAIL PROTECTED]>
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 ;


---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
       subscribe-nomail command to [EMAIL PROTECTED] so that your
       message can get through to the mailing list cleanly

Reply via email to