Subject | Re: [firebird-support] values null in summation of record |
---|---|
Author | Michael Ludwig |
Post date | 2012-05-17T14:16:51Z |
Ismael L. Donis Garcia schrieb am 17.05.2012 um 09:06 (-0400):
select id, coalesce(sum(saldo), 0) as saldo
from table2
group by id;
Michael
>Use COALESCE to coerce NULL into 0:
> select sum(t.saldo) as saldo from table1 t where t.id=XXXXX
>
> returns 1 record with value null
>
> As I make in order that do not return records in this case?
select id, coalesce(sum(saldo), 0) as saldo
from table2
group by id;
Michael