Re: Null in the where-clause

From: Darren Ferguson <darren(at)crystalballinc(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 16:15:27
Message-ID: Pine.LNX.4.44.0207081213520.22192-100000@thread.crystalballinc.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)postgresql(dot)org so that your
> message can get through to the mailing list cleanly
>
>

--
Darren Ferguson

In response to

Browse pgsql-general by date

  From Date Subject
Next Message terry 2002-07-08 16:17:30 Re: I am being interviewed by OReilly
Previous Message Peter Schuller 2002-07-08 16:11:34 Frontend/backend protocol authentication