Subject Re: [firebird-support] Re: summation of two select
Author Paul Vinkenoog
Hello Ed,

> Thank you for your respohse. I have not seen Coalesce before.

It was introduced in Firebird 1.5. For details, see

> Firebird 1.5 balks at the "Select" in the 3rd line "Token unknown, line 3, char 5."
> > COALESCE( PI.Balance,0) + COALESCE(
> > SELECT(PAI.Balance) FROM PersonActInfo PAI where PAI.Person_ID
> ^^^^^^

It may work with a pair of parentheses around the subselect:

COALESCE(PI.Balance, 0)
COALESCE((SELECT(PAI.Balance) FROM PersonActInfo PAI where PAI.Person_ID = PI.Person_ID), 0)
as Balance
FROM PersonInfo PI
WHERE PI.Person_ID = 154

In 2.5 it should also work without that, I think.

Paul Vinkenoog