Re: selecting all records where a column is null

From: Fran Fabrizio <ffabrizio(at)mmrd(dot)com>
To: "Elmshauser, Erik" <erike(at)pbgnw(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: selecting all records where a column is null
Date: 2002-06-20 19:48:30
Message-ID: 3D12318E.8040305@mmrd.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Elmshauser, Erik wrote:

>Hi, I am trying to select every record from a table where a specific
>column does not have a value in it yet. Is there a way to express that
>in a SQL statement? Here are the few I tried:
>
>select * from table where field;
>select * from table where field = '';
>select * from table where field = NULL;
>
select * from table where field is null;

is rather than =. Since null is undefined, it's not appropriate to test
for equality to null.

-Fran

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Manfred Koizar 2002-06-20 19:54:07 Re: Yet another "Why won't PostgreSQL use my index?"
Previous Message Dave Page 2002-06-20 19:33:45 Re: pgAdmin II