Subject | Re: [firebird-support] coerce null to 0 |
---|---|
Author | bill_lam |
Post date | 2006-06-26T14:55:54Z |
Jason Dodson wrote:
Incidentally, I want
select coalesce(sum(amt),0) from balc where ....
amt itself never null, but the where clause may select no rows.
regards,
bill
> You have it backwards:Thank you for all.
>
> select sum(coalesce(amt,0))...
>
> amt being the field to evaluate
> 0 being the value to replace null with
>
> Nick wrote:
>> select sum(coalesce(0,amt)) ...
>>
>
Incidentally, I want
select coalesce(sum(amt),0) from balc where ....
amt itself never null, but the where clause may select no rows.
regards,
bill