pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Stephan Szabo <sszabo@megazone23.bigpanda.com>
To: Don Park <donp+postgresql@klickitat.st>
Cc: pgsql-sql@postgresql.org
Subject: Re: numeric fields and null
Date: Thu, 22 May 2003 15:25:56 -0700 (PDT)
Message-ID: <20030522152454.P46888-100000@megazone23.bigpanda.com> (raw)
In-Reply-To: <Pine.LNX.4.51.0305221317360.17969@amidala.klickitat.st>

On Thu, 22 May 2003, Don Park wrote:

> Im trying to pull out all records in a table where field
> 'postaladdressid=null' but I cant figure this out.
>
> \d users
> ....
> id               | numeric
> postaladdressid  | numeric
> ....
>
> adhoc=# update users set postaladdressid=null where id=50;
> UPDATE 1
>
> adhoc=# select id,postaladdressid from users where postaladdressid=null;
>  id | postaladdressid
> ----+-----------------
> (0 rows)
>
> Why did it not select record 50?

Because NULL=NULL is not true (it's unknown).  Use IS NULL if you want to
see if something is NULL.




view thread (8+ messages)  latest in thread

Message-ID: <20030522152454.P46888-100000@megazone23.bigpanda.com>
Permalink:  ../20030522152454.P46888-100000@megazone23.bigpanda.com/
Also on:    postgresql.org/message-id/20030522152454.P46888-100000@megazone23.bigpanda.com

 · 

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: sszabo@megazone23.bigpanda.com, donp+postgresql@klickitat.st
  Subject: Re: numeric fields and null
  In-Reply-To: <20030522152454.P46888-100000@megazone23.bigpanda.com>

* 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