Subject | Re: [firebird-support] Looking for explanation of count and group by |
---|---|
Author | Milan Babuskov |
Post date | 2003-09-12T15:31:28Z |
Bob Murdoch wrote:
some other server does it or ...?
There are no rows in table, so we don't expect any rows in result which
show values of that column (as first column of result). It wouldn't give
us any information if we know that we have zero null values in that
column. If we were to follow your logic, we could expect to also see a
row like: column1=10 and a count of 0, etc.
--
Milan Babuskov
http://fbexport.sourceforge.net
> Just ran across a situation that I can't explain. Not because anything isGood.
> wrong, just because I can't figure it out.
>
> Given the table "create table test_group_by(column1 integer)"
>
> I can run this query and receive a single row result set with a count of 0:
>
> select
> count(*)
> from
> test_group_by
> However, if I change the query toWhy would you expect it? Did you read it in some book, or maybe seen
>
> select
> column1, count(*)
> from
> test_group_by
> group by
> column1
> I recieve an empty result set. I think I would have expected a single row,
> with column1=NULL and a count of 0.
some other server does it or ...?
There are no rows in table, so we don't expect any rows in result which
show values of that column (as first column of result). It wouldn't give
us any information if we know that we have zero null values in that
column. If we were to follow your logic, we could expect to also see a
row like: column1=10 and a count of 0, etc.
--
Milan Babuskov
http://fbexport.sourceforge.net