Received: from news.tht.net (news.hub.org [216.126.91.242]) by postgresql.org (8.11.3/8.11.4) with ESMTP id g05KvVm95088 for ; Sat, 5 Jan 2002 15:57:31 -0500 (EST) (envelope-from news@news.tht.net) Received: (from news@localhost) by news.tht.net (8.11.4/8.11.4) id g05Kt0R12017 for pgsql-sql@postgresql.org; Sat, 5 Jan 2002 15:55:00 -0500 (EST) (envelope-from news) From: "Karl Raven" X-Newsgroups: comp.databases.postgresql.sql Subject: Re: change null to 0 in SQL script Date: Sun, 6 Jan 2002 04:54:07 +0800 Organization: Hub.Org Networking Services (http://www.hub.org) Lines: 26 Message-ID: References: <3C360816.1080103@wtal.de> X-Complaints-To: news@hub.org X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2600.0000 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 To: pgsql-sql@postgresql.org X-Archive-Number: 200201/100 X-Sequence-Number: 6189 thanks will try it.. "ThomasR" wrote in message news:3C360816.1080103@wtal.de... > 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 >