select, where and null-values (or: select null<>'1' is fuzzy) - Mailing list pgsql-general

From Peter Pilsl
Subject select, where and null-values (or: select null<>'1' is fuzzy)
Date
Msg-id 20010612185232.C75862@i3.atat.at
Whole thread Raw
Responses Re: select, where and null-values (or: select null<>'1' is fuzzy)  (Peter Eisentraut <peter_e@gmx.net>)
Re: select, where and null-values (or: select null<>'1' is fuzzy)  ("Thalis A. Kalfigopoulos" <thalis@cs.pitt.edu>)
Re: select, where and null-values (or: select null<>'1' is fuzzy)  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
List pgsql-general
I've a problem when selecting values out a table.

manana=# select * from test;
 l1 | l2 | l3
----+----+----
 1  | 2  | 3
 2  | 3  | 4
 3  | 4  | 5
 4  | 5  | 6
    | 5  | 6
(5 rows)

where l1 is NULL in the last line.
now I do

manana=# select * from test where l1<>1;
 l1 | l2 | l3
----+----+----
 2  | 3  | 4
 3  | 4  | 5
 4  | 5  | 6
(3 rows)
and dont get the line with the null-entry !
In fact the problem is also describeable like this:

manana=# select NULL<>'1';
 ?column?
----------

(1 row)

This gives neither true nor false.

Why is this like this and how can I work around ?

thnx,
peter


--
mag. peter pilsl

phone: +43 676 3574035
fax  : +43 676 3546512
email: pilsl@goldfisch.at
sms  : pilsl@max.mail.at

pgp-key available

pgsql-general by date:

Previous
From: Alexander Solianic
Date:
Subject: Re: Current database name
Next
From: "Flacco"
Date:
Subject: Rename database?