Re: comparing nulls - Mailing list pgsql-sql

From D'Arcy J.M. Cain
Subject Re: comparing nulls
Date
Msg-id 200401200906.19322.darcy@druid.net
Whole thread Raw
In response to comparing nulls  (Kenneth Gonsalves <lawgon@thenilgiris.com>)
List pgsql-sql
On January 20, 2004 08:43 am, Kenneth Gonsalves wrote:
> in postgres7.1 i had a table where an integer field could be null. There
> was no default value. a select statement like so:
> 'select * from table where field = null'
> would give all the rows where that field had no value.
> on porting to 7.3.2, this doesnt work. How to do this?

As per the SQL standard:

SELECT * FROM table WHERE field IS NOT NULL;

-- 
D'Arcy J.M. Cain <darcy@{druid|vex}.net>   |  Democracy is three wolves
http://www.druid.net/darcy/                |  and a sheep voting on
+1 416 425 1212     (DoD#0082)    (eNTP)   |  what's for dinner.


pgsql-sql by date:

Previous
From: Chris Bowlby
Date:
Subject: Re: comparing nulls
Next
From: Luis Sousa
Date:
Subject: Re: Database diagram