Subject | NULLS FIRST doesn't work with DISTINCT clause |
---|---|
Author | purrinhos |
Post date | 2004-02-27T13:52:52Z |
Hi,
Firebird 1.5 Release, the next example produces a result I think is
wrong:
The test database:
CREATE TABLE TEST(
A VARCHAR(10),
B INTEGER);
Populated with:
INSERT INTO TEST(A, B) VALUES('A',1);
INSERT INTO TEST(A, B) VALUES('B',2);
INSERT INTO TEST(A, B) VALUES('B',3);
INSERT INTO TEST(A, B) VALUES('A',4);
INSERT INTO TEST(A, B) VALUES('A',5);
INSERT INTO TEST(B) VALUES(6);
INSERT INTO TEST(B) VALUES(7);
INSERT INTO TEST(B) VALUES(8);
And the query:
SELECT DISTINCT A FROM TEST ORDER BY A NULLS FIRST
The result obtained is:
A
B
NULL
And the conclusion: NULLS FIRST doesn't work with DISTINCT, I don't
know if this is the correct behavior.
Francisco.
Firebird 1.5 Release, the next example produces a result I think is
wrong:
The test database:
CREATE TABLE TEST(
A VARCHAR(10),
B INTEGER);
Populated with:
INSERT INTO TEST(A, B) VALUES('A',1);
INSERT INTO TEST(A, B) VALUES('B',2);
INSERT INTO TEST(A, B) VALUES('B',3);
INSERT INTO TEST(A, B) VALUES('A',4);
INSERT INTO TEST(A, B) VALUES('A',5);
INSERT INTO TEST(B) VALUES(6);
INSERT INTO TEST(B) VALUES(7);
INSERT INTO TEST(B) VALUES(8);
And the query:
SELECT DISTINCT A FROM TEST ORDER BY A NULLS FIRST
The result obtained is:
A
B
NULL
And the conclusion: NULLS FIRST doesn't work with DISTINCT, I don't
know if this is the correct behavior.
Francisco.