X-Original-To: pgsql-sql@postgresql.org Received: from localhost (unknown [64.117.224.193]) by developer.postgresql.org (Postfix) with ESMTP id 2A3749232D7 for ; Thu, 22 May 2003 20:31:52 -0400 (EDT) Received: from developer.postgresql.org ([64.117.224.193]) by localhost (developer.postgresql.org [64.117.224.193:10024]) (amavisd-new) with ESMTP id 00481-09 for ; Thu, 22 May 2003 20:31:20 -0400 (EDT) Received: from megazone.bigpanda.com (megazone.bigpanda.com [63.150.15.178]) by developer.postgresql.org (Postfix) with ESMTP id C370E92573F for ; Thu, 22 May 2003 18:25:57 -0400 (EDT) Received: by megazone.bigpanda.com (Postfix, from userid 1001) id 1321BD610; Thu, 22 May 2003 15:25:57 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by megazone.bigpanda.com (Postfix) with ESMTP id 08D035C11; Thu, 22 May 2003 15:25:57 -0700 (PDT) Date: Thu, 22 May 2003 15:25:56 -0700 (PDT) From: Stephan Szabo To: Don Park Cc: Subject: Re: numeric fields and null In-Reply-To: Message-ID: <20030522152454.P46888-100000@megazone23.bigpanda.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new X-Archive-Number: 200305/435 X-Sequence-Number: 13600 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.