Subject | Count(distinct ...) problem? |
---|---|
Author | eos_dev |
Post date | 2006-02-17T23:17:39Z |
A short example (Firebird v1.5.3):
CREATE TABLE tbl(number INTEGER NOT NULL PRIMARY KEY);
INSERT INTO tbl VALUES(2147483647);
Now:
(1)
SELECT COUNT(DISTINCT number) FROM tbl;
returns this result:
COUNT
============
0
while:
(2)
SELECT COUNT(number) FROM tbl;
is ok (COUNT==1). If number < 2147483647 (2^31-1) everything is
right.
What am I missing? Is this a known bug?
Thanks!
CREATE TABLE tbl(number INTEGER NOT NULL PRIMARY KEY);
INSERT INTO tbl VALUES(2147483647);
Now:
(1)
SELECT COUNT(DISTINCT number) FROM tbl;
returns this result:
COUNT
============
0
while:
(2)
SELECT COUNT(number) FROM tbl;
is ok (COUNT==1). If number < 2147483647 (2^31-1) everything is
right.
What am I missing? Is this a known bug?
Thanks!