Subject | Re: coerce null to 0 |
---|---|
Author | Adam |
Post date | 2006-06-26T23:52:44Z |
--- In firebird-support@yahoogroups.com, bill_lam <bill_lam@...> wrote:
You found the 1% from my previous response.
select Coalesce(sum(amt), 0) from balc where 1=0
Of course I would hope you never actually do a 'where 1=0' in real
life. It evaluates for every record.
Adam
>to zero,
> is there any method to coerce possible null from aggregate function
You found the 1% from my previous response.
> egThe Coalesce function converts null to whatever you want. So
> select sum(amt) from balc where 1=0
> it returns null, but I want 0 instead.
select Coalesce(sum(amt), 0) from balc where 1=0
Of course I would hope you never actually do a 'where 1=0' in real
life. It evaluates for every record.
Adam