Subject | Re: [firebird-support] CASE statement Question |
---|---|
Author | Arno Brinkman |
Post date | 2003-11-03T14:59:40Z |
Hi,
In Firebird 1.5 you can do:
SELECT
Code,
CASE WHEN SUM(Amount) IS NULL THEN 0 ELSE Amount END
FROM
TableA
or
SELECT
Code,
COALESCE(SUM(Amount), 0)
FROM
TableA
Regards,
Arno Brinkman
ABVisie
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Firebird links :
http://www.firebirdsql.com
http://www.firebirdsql.info
http://www.fingerbird.de/
http://www.comunidade-firebird.org/
Nederlandse firebird nieuwsgroep :
news://80.126.130.81
> SELECT Code, SUM(CASE Amount WHEN NULL THEN 0 else Amount) from TableAfailure for me.
>
> But this is not working. I tried to use IF..THEN..ELSE But it was also
In Firebird 1.5 you can do:
SELECT
Code,
CASE WHEN SUM(Amount) IS NULL THEN 0 ELSE Amount END
FROM
TableA
or
SELECT
Code,
COALESCE(SUM(Amount), 0)
FROM
TableA
Regards,
Arno Brinkman
ABVisie
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Firebird links :
http://www.firebirdsql.com
http://www.firebirdsql.info
http://www.fingerbird.de/
http://www.comunidade-firebird.org/
Nederlandse firebird nieuwsgroep :
news://80.126.130.81