Subject | RE: [firebird-support] Count(id) returns null. although count should never return null... |
---|---|
Author | Kevin Stanton |
Post date | 2005-09-06T17:45:10Z |
Why would you ever use a group by clause when there are no groupings?
_____
From: firebird-support@yahoogroups.com
[mailto:firebird-support@yahoogroups.com] On Behalf Of asakin312
Sent: Tuesday, September 06, 2005 10:15 AM
To: firebird-support@yahoogroups.com
Subject: [firebird-support] Count(id) returns null. although count should
never return null...
Hi,
I ran the following query on a regular table:
SELECT count(id) FROM FILES WHERE 0=1 group by id
and I got NULL as an answer.
The following query works ok and returns 0:
SELECT count(id) FROM FILES WHERE 0=1
(same as the above only without the group by).
Is this the correct behavior?
How can I get 0 as an answer from the first query?
Thanks,
Ariel.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Visit http://firebird.sourceforge.net and click the Resources item
on the main (top) menu. Try Knowledgebase and FAQ links !
Also search the knowledgebases at http://www.ibphoenix.com
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
_____
YAHOO! GROUPS LINKS
* Visit your group "firebird-support
<http://groups.yahoo.com/group/firebird-support> " on the web.
* To unsubscribe from this group, send an email to:
firebird-support-unsubscribe@yahoogroups.com
<mailto:firebird-support-unsubscribe@yahoogroups.com?subject=Unsubscribe>
* Your use of Yahoo! Groups is subject to the Yahoo!
<http://docs.yahoo.com/info/terms/> Terms of Service.
_____
[Non-text portions of this message have been removed]
_____
From: firebird-support@yahoogroups.com
[mailto:firebird-support@yahoogroups.com] On Behalf Of asakin312
Sent: Tuesday, September 06, 2005 10:15 AM
To: firebird-support@yahoogroups.com
Subject: [firebird-support] Count(id) returns null. although count should
never return null...
Hi,
I ran the following query on a regular table:
SELECT count(id) FROM FILES WHERE 0=1 group by id
and I got NULL as an answer.
The following query works ok and returns 0:
SELECT count(id) FROM FILES WHERE 0=1
(same as the above only without the group by).
Is this the correct behavior?
How can I get 0 as an answer from the first query?
Thanks,
Ariel.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Visit http://firebird.sourceforge.net and click the Resources item
on the main (top) menu. Try Knowledgebase and FAQ links !
Also search the knowledgebases at http://www.ibphoenix.com
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
_____
YAHOO! GROUPS LINKS
* Visit your group "firebird-support
<http://groups.yahoo.com/group/firebird-support> " on the web.
* To unsubscribe from this group, send an email to:
firebird-support-unsubscribe@yahoogroups.com
<mailto:firebird-support-unsubscribe@yahoogroups.com?subject=Unsubscribe>
* Your use of Yahoo! Groups is subject to the Yahoo!
<http://docs.yahoo.com/info/terms/> Terms of Service.
_____
[Non-text portions of this message have been removed]