From: ThomasR <trx@wtal.de>
To: pgsql-sql@postgresql.org
Subject: Re: change null to 0 in SQL script
Date: Fri, 04 Jan 2002 20:52:54 +0100
Message-ID: <3C360816.1080103@wtal.de> (raw)
References: <a10ojd$1v4q$1@news.tht.net>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: trx@wtal.de
Subject: Re: change null to 0 in SQL script
In-Reply-To: <3C360816.1080103@wtal.de>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox