Re: Cast question (NULL -> NUMERIC) - Mailing list pgsql-novice

From Henry House
Subject Re: Cast question (NULL -> NUMERIC)
Date
Msg-id 20010714103506.A20615@houseag.com
Whole thread Raw
In response to Re: Cast question (NULL -> NUMERIC)  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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

Attachment

pgsql-novice by date:

Previous
From: Tom Lane
Date:
Subject: Re: Cast question (NULL -> NUMERIC)
Next
From: Barry Hoggard
Date:
Subject: Returning a value from an update or insert using DBD::Pg