Re: Null in the where-clause - Mailing list pgsql-general

From Darren Ferguson
Subject Re: Null in the where-clause
Date
Msg-id Pine.LNX.4.44.0207081213520.22192-100000@thread.crystalballinc.com
Whole thread Raw
In response to Null in the where-clause  (michael_walzl@yahoo.de (Michael Walzl))
List pgsql-general
No you do not have to re-install the server.

When using NULL you may not use the = sign because a null is an undefined
piece of data meaning it may exist but you don't know the value or it may
not exist or you just don't know what is meant to go into that field.

Instead of equal use the IS command and say

WHERE field IS NULL

This will produce the result you are looking for.

HTH

Darren

On 5 Jul 2002, Michael Walzl wrote:

> Hello everybody,
>
> 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.
> What could be the problem? Do I have to reinstall the server
> with a special parameter?
>
> Thanx in advance
> Michael Walzl
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo@postgresql.org so that your
> message can get through to the mailing list cleanly
>
>

--
Darren Ferguson




pgsql-general by date:

Previous
From: Francisco Reyes
Date:
Subject: Re: CRC function?
Next
From: "Peter Alberer"
Date:
Subject: Speeding up subselect ?