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 05112D1B44B for ; Fri, 19 Dec 2003 16:14:35 +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 28017-04 for ; Fri, 19 Dec 2003 12:13:46 -0400 (AST) Received: from mta3.snet.net (mta3.snet.net [204.60.203.69]) by svr1.postgresql.org (Postfix) with ESMTP id 3D386D1B4AD for ; Fri, 19 Dec 2003 12:13:30 -0400 (AST) Received: from kencast.com (167.95.252.64.snet.net [64.252.95.167]) by mta3.snet.net (8.12.3/8.12.3/SNET-smtp-1.2/D-1.1.1.1/O-1.1.1.1) with ESMTP id hBJGDHBj002064; Fri, 19 Dec 2003 11:13:17 -0500 (EST) Message-ID: <3FE32368.30303@kencast.com> Date: Fri, 19 Dec 2003 11:12:24 -0500 From: Wei Weng User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.6b) Gecko/20031208 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Geoffrey Cc: pgsql-sql@postgresql.org Subject: Re: testing for null value in integer field? References: <3FE32231.5030207@3times25.net> In-Reply-To: <3FE32231.5030207@3times25.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200312/130 X-Sequence-Number: 16296 Geoffrey wrote: > How does one check for an unset value in an integer field? > > I've tried such things as: > > select ..... where intnumber = '' > select ...... where intnumber = ? > select ..... where intnumber = NULL > > Thanks. > It is actually WHERE intnumber IS NULL. You don't use operator = to compare with NULLs, you use IS. HTH. Wei