Re: Cast question (NULL -> NUMERIC)

Поиск
Список
Период
Сортировка
От Henry House
Тема Re: Cast question (NULL -> NUMERIC)
Дата
Msg-id 20010714103506.A20615@houseag.com
обсуждение исходный текст
Ответ на Re: Cast question (NULL -> NUMERIC)  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-novice
On Fri, Jul 13, 2001 at 05:11:25PM -0400, Tom Lane wrote:
[..]
> Yeah, for some unfathomable reason SQL92 defines SUM() of no rows to
> return NULL, rather than zero as any mathematician would say it should.
>
> Use COALESCE(SUM(...), 0) to replace the null result by 0.
>
>             regards, tom lane

That did the trick. Thanks!

--
Henry House
OpenPGP key available from http://romana.hajhouse.org/hajhouse.asc

Вложения

В списке pgsql-novice по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Cast question (NULL -> NUMERIC)
Следующее
От: Barry Hoggard
Дата:
Сообщение: Returning a value from an update or insert using DBD::Pg