Re: math problem - Mailing list pgsql-general

From Vincent Stoessel
Subject Re: math problem
Date
Msg-id 3D415BD6.70208@xaymaca.com
Whole thread Raw
In response to Re: math problem  ("Roderick A. Anderson" <raanders@acm.org>)
Responses Re: math problem
List pgsql-general
Thank You all for the answer.
I appreciate it a lot. For the record the function is spelled
coalesce.
Later


Roderick A. Anderson wrote:
> On Thu, 25 Jul 2002, Vincent Stoessel wrote:
>
>
>>now my problem comes into play when one of the
>>columns is empty. I always get a NULL or empty total.
>>this makes sence since NULL + 5 does not produce anything.
>
>
> I think colesce is your friend
>
> select cola, colb, sum(colesce(cola,0) + colesce(colb,0)) from ....
>
> I've never had to use it put I've seen this situation addressed here
> before.   Table 9.3, pg 113 the Elephant book.
>
>
> Rod


--
Vincent Stoessel
Linux Systems Developer
vincent xaymaca.com

Attachment

pgsql-general by date:

Previous
From: Justin Clift
Date:
Subject: Re: Bad HTML in Mail List Archives
Next
From: Andrew Sullivan
Date:
Subject: Re: archives dead again?