pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: D'Arcy J.M. Cain <darcy@druid.net>
To: Kenneth Gonsalves <lawgon@thenilgiris.com>
To: pgsql-sql@postgresql.org
Subject: Re: comparing nulls
Date: Tue, 20 Jan 2004 09:06:19 -0500
Message-ID: <200401200906.19322.darcy@druid.net> (raw)
In-Reply-To: <04012019131206.01434@thenilgiris.com>
References: <04012019131206.01434@thenilgiris.com>

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.



view thread (9+ messages)  latest in thread

Message-ID: <200401200906.19322.darcy@druid.net>
Permalink:  ../200401200906.19322.darcy@druid.net/
Also on:    postgresql.org/message-id/200401200906.19322.darcy@druid.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: darcy@druid.net, lawgon@thenilgiris.com
  Subject: Re: comparing nulls
  In-Reply-To: <200401200906.19322.darcy@druid.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox