Subject | Re: coalesce over an empty query |
---|---|
Author | Adam |
Post date | 2005-10-14T00:29:21Z |
--- In firebird-support@yahoogroups.com, "cgar1136" <cgar1136@y...>
wrote:
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
returned?
Adam
wrote:
>like
> When i use a coalesce sentence over a query that returns no rows
> this:No it doesn't.
>
> select coalesce(null ,0) as alwaysnull
> from rdb$database
> where rdb$relation_id < -100000
>
> The coalesce is ignored and always returns the null value
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
returned?
Adam