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!
OpenPGP key available from http://romana.hajhouse.org/hajhouse.asc
In response to
pgsql-novice by date
|Next:||From: Barry Hoggard||Date: 2001-07-15 02:52:24|
|Subject: Returning a value from an update or insert using DBD::Pg|
|Previous:||From: Todd T. Fries||Date: 2001-07-13 22:03:49|
|Subject: Re: Serial field|