Received: from news.tht.net (news.hub.org [216.126.91.242]) by postgresql.org (8.11.3/8.11.4) with ESMTP id g04JvSm82827 for ; Fri, 4 Jan 2002 14:57:28 -0500 (EST) (envelope-from news@news.tht.net) Received: (from news@localhost) by news.tht.net (8.11.4/8.11.4) id g04JfM093865 for pgsql-sql@postgresql.org; Fri, 4 Jan 2002 14:41:22 -0500 (EST) (envelope-from news) From: ThomasR X-Newsgroups: comp.databases.postgresql.sql Subject: Re: change null to 0 in SQL script Date: Fri, 04 Jan 2002 20:52:54 +0100 Organization: Hub.Org Networking Services (http://www.hub.org) Lines: 17 Message-ID: <3C360816.1080103@wtal.de> References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: news@hub.org User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.7) Gecko/20011221 X-Accept-Language: en-us, de To: pgsql-sql@postgresql.org X-Archive-Number: 200201/94 X-Sequence-Number: 6183 Karl Raven wrote: > I like to change a null value of a query to 0 in the SQL script. I know how > to do it in MS-SQL server and MS-Access but those commands does not work in > pg-sql. > > Anyone has any ideas? > > Thanks > I think the following should work: select coalesce( my_attrib, 0 ) from my_tab Thomas