Re: change null to 0 in SQL script - Mailing list pgsql-sql

From ThomasR
Subject Re: change null to 0 in SQL script
Date
Msg-id 3C360816.1080103@wtal.de
Whole thread Raw
In response to change null to 0 in SQL script  ("Karl Raven" <lcaasia@pd.jaring.my>)
List pgsql-sql
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



pgsql-sql by date:

Previous
From: Katona Gabor
Date:
Subject: Re: How to union tables and have a field with UNIQUE constraint?
Next
From: "Chris Sypolt"
Date:
Subject: Re: SQL syntax help needed