Re: math problem

From: Vincent Stoessel <vincent(at)xaymaca(dot)com>
To: "Roderick A(dot) Anderson" <raanders(at)acm(dot)org>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: math problem
Date: 2002-07-26 14:25:26
Message-ID: 3D415BD6.70208@xaymaca.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Andrew Sullivan 2002-07-26 14:27:23 Re: archives dead again?
Previous Message Justin Clift 2002-07-26 14:25:07 Re: Bad HTML in Mail List Archives