should be it

This commit is contained in:
2025-10-24 19:21:19 -05:00
parent a4b23fc57c
commit f09560c7b1
14047 changed files with 3161551 additions and 1 deletions

View File

@@ -0,0 +1,43 @@
# name: test/sql/aggregate/distinct/issue2656.test
# description: Issue #2656: DISTINCT + ORDER produces incorrect result
# group: [distinct]
statement ok
PRAGMA enable_verification
statement ok
CREATE TABLE T (t1 int, t2 int);
statement ok
INSERT INTO t VALUES (1, 1), (1, 2);
query I
SELECT DISTINCT t1
FROM T
ORDER BY t1, t2;
----
1
query II
SELECT DISTINCT ON (1) t1, t2
FROM T
ORDER BY t1, t2;
----
1 1
query I
SELECT DISTINCT t1 FROM T
UNION
SELECT DISTINCT t1 FROM T
ORDER BY t1;
----
1
query I
SELECT DISTINCT t1 FROM T
UNION ALL
SELECT DISTINCT t1 FROM T
ORDER BY t1;
----
1
1