Subject Re: coalesce over an empty query
Author Adam
--- In, "cgar1136" <cgar1136@y...>
> When i use a coalesce sentence over a query that returns no rows
> this:
> select coalesce(null ,0) as alwaysnull
> from rdb$database
> where rdb$relation_id < -100000
> The coalesce is ignored and always returns the null value

No it doesn't.

It always returns 0 records, not 1 record with a null. Coalesce
substitutes a a value if the field is null. Sometimes the grid
components used by various tools make it look like it returned a
null, but it doesn't.

When you think about it, How can a field have a null state on a
particular field in a particular record if there are no records