X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (neptune.hub.org [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 8ECA0D1D268 for ; Tue, 20 Jan 2004 14:06:54 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 26591-06 for ; Tue, 20 Jan 2004 10:06:26 -0400 (AST) Received: from druid.net (druid.net [216.126.72.98]) by svr1.postgresql.org (Postfix) with ESMTP id ADD37D1D202 for ; Tue, 20 Jan 2004 10:06:22 -0400 (AST) Received: by druid.net (Postfix, from userid 1000) id ADE8C1BC7; Tue, 20 Jan 2004 09:06:20 -0500 (EST) From: "D'Arcy J.M. Cain" To: Kenneth Gonsalves , pgsql-sql@postgresql.org Subject: Re: comparing nulls Date: Tue, 20 Jan 2004 09:06:19 -0500 User-Agent: KMail/1.5.4 References: <04012019131206.01434@thenilgiris.com> In-Reply-To: <04012019131206.01434@thenilgiris.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200401200906.19322.darcy@druid.net> X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200401/179 X-Sequence-Number: 16572 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 | 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.