Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ambiguous results for select with distinct and order by [CORE1487] #1902

Open
firebird-automations opened this issue Sep 30, 2007 · 1 comment

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: Nikolay Ponomarenko (pnv82)

Votes: 2

select distinct(t.f1) from table1 t order by http://t.id

such queries, with differrent list of fields for distinct and order clause, are possible in FB, but results of ordering depends on ondisk data layout.
Such behaviour are forbidden, at least, by Oracle and PostgreSQL.

CREATE TABLE TABLE1 (
ID INTEGER NOT NULL,
F1 VARCHAR(10)
);

INSERT INTO TABLE1 (ID, F1) VALUES (1, 'q');
INSERT INTO TABLE1 (ID, F1) VALUES (2, 'w');
INSERT INTO TABLE1 (ID, F1) VALUES (3, 'e');
INSERT INTO TABLE1 (ID, F1) VALUES (4, 'r');
INSERT INTO TABLE1 (ID, F1) VALUES (5, 't');
INSERT INTO TABLE1 (ID, F1) VALUES (6, 'q');
INSERT INTO TABLE1 (ID, F1) VALUES (7, 'w');
COMMIT WORK;

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

Workflow: jira [ 13200 ] => Firebird [ 15377 ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant