Re: CASE/WHEN behavior with NULLS

From: Chris Angelico <rosuav(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: CASE/WHEN behavior with NULLS
Date: 2012-09-01 02:41:59
Message-ID: CAPTjJmpTfNYiWfLn=Nba80HwqVdEuWxTEsb-4my=nCgt_AAbfw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sat, Sep 1, 2012 at 12:07 PM, David Johnston <polobo(at)yahoo(dot)com> wrote:
> These are not equivalent if some values of foo are not-null and you want the sum of all non-null values while replacing any nulls with zero. So the decision depends on what and why you are summing.

It comes to the same result with SUM though isn't it?

ChrisA

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2012-09-01 02:49:49 Re: CASE/WHEN behavior with NULLS
Previous Message David Johnston 2012-09-01 02:07:13 Re: CASE/WHEN behavior with NULLS