Re: CASE - Mailing list pgsql-sql

From Manfred Koizar
Subject Re: CASE
Date
Msg-id 6ericvkpd536s9a51atc05fsm45oib7mpf@4ax.com
Whole thread Raw
In response to CASE  ("James Taylor" <jtx@hatesville.com>)
List pgsql-sql
On Sun, 18 May 2003 23:59:46 -0700, "James Taylor"
<jtx@hatesville.com> wrote:
>select case(sum(numbers)) when null then 0 else sum(numbers) end from
>list_results;
>
>That... Doesn't work.

SELECT CASE WHEN SUM(numbers) IS NULL THEN 0 ELSE SUM(numbers) END ...

or

SELECT COALESCE(SUM(numbers), 0) FROM ...

ServusManfred


pgsql-sql by date:

Previous
From: Rod Taylor
Date:
Subject: Re: CASE
Next
From: Tom Lane
Date:
Subject: Re: CASE