Re: Null in the where-clause

From: Alvaro Herrera <alvherre(at)atentus(dot)com>
To: Michael Walzl <michael_walzl(at)yahoo(dot)de>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Null in the where-clause
Date: 2002-07-08 17:28:05
Message-ID: Pine.LNX.4.44.0207081327010.5552-100000@cm-lcon-46-187.cm.vtr.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Michael Walzl dijo:

> I've got a problem with the "null"-statement within the where-clause.
> I installed the postgres-server 7.2.1 on a Suse Linux machine.
> Then I imported an existing databasedump.
> But when I make the following query:
> select * from tbl_categories where categoryid=null;
> I get 0 rows as result, but there are several records, which
> corrsponds to my query.

No, there is none. NULL never equals anything, not even null itself.

Try
select * from tbl_categories where categoryid is null;

--
Alvaro Herrera (<alvherre[a]atentus.com>)
"Ninguna manada de bestias tiene una voz tan horrible como la humana" (Orual)

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Hans-Juergen Schoenig 2002-07-08 17:32:24 Re: Query Speed!!!
Previous Message Robert L Mathews 2002-07-08 17:16:05 Re: I am being interviewed by OReilly