Re: change null to 0 in SQL script

Поиск
Список
Период
Сортировка
От ThomasR
Тема Re: change null to 0 in SQL script
Дата
Msg-id 3C360816.1080103@wtal.de
обсуждение исходный текст
Ответ на change null to 0 in SQL script  ("Karl Raven" <lcaasia@pd.jaring.my>)
Список 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 по дате отправления:

Предыдущее
От: Katona Gabor
Дата:
Сообщение: Re: How to union tables and have a field with UNIQUE constraint?
Следующее
От: "Chris Sypolt"
Дата:
Сообщение: Re: SQL syntax help needed