2021-06-22 11:25:14 +00:00
|
|
|
DROP TABLE IF EXISTS t1;
|
|
|
|
|
|
|
|
CREATE TABLE t1 (`a` UInt32, `b` UInt32, `c` UInt32 ) ENGINE = Memory;
|
|
|
|
INSERT INTO t1 VALUES (1, 1, 1), (1, 1, 2), (2, 2, 2), (1, 2, 2);
|
|
|
|
|
|
|
|
SELECT DISTINCT ON (a, b) a, b, c FROM t1;
|
2021-07-06 09:17:26 +00:00
|
|
|
SELECT DISTINCT ON (a, b) * FROM t1;
|
|
|
|
SELECT DISTINCT ON (a) * FROM t1;
|
2021-06-22 11:25:14 +00:00
|
|
|
|
2021-07-08 12:45:23 +00:00
|
|
|
-- fuzzer will fail, enable when fixed
|
2024-05-31 08:44:16 +00:00
|
|
|
-- SELECT DISTINCT ON (a, b) a, b, c FROM t1 LIMIT 1 BY a, b; -- { clientError SYNTAX_ERROR }
|
2021-07-06 09:17:26 +00:00
|
|
|
|
2024-05-31 08:44:16 +00:00
|
|
|
-- SELECT DISTINCT ON a, b a, b FROM t1; -- { clientError SYNTAX_ERROR }
|
|
|
|
-- SELECT DISTINCT ON a a, b FROM t1; -- { clientError SYNTAX_ERROR }
|
2021-07-06 09:17:26 +00:00
|
|
|
|
|
|
|
-- "Code: 47. DB::Exception: Missing columns: 'DISTINCT'" - error can be better
|
2024-05-30 12:27:25 +00:00
|
|
|
-- SELECT DISTINCT ON (a, b) DISTINCT a, b FROM t1; -- { serverError UNKNOWN_IDENTIFIER }
|
2024-05-31 08:44:16 +00:00
|
|
|
-- SELECT DISTINCT DISTINCT ON (a, b) a, b FROM t1; -- { clientError SYNTAX_ERROR }
|
2021-07-06 09:17:26 +00:00
|
|
|
|
2024-05-31 08:44:16 +00:00
|
|
|
-- SELECT ALL DISTINCT ON (a, b) a, b FROM t1; -- { clientError SYNTAX_ERROR }
|
|
|
|
-- SELECT DISTINCT ON (a, b) ALL a, b FROM t1; -- { clientError SYNTAX_ERROR }
|
2021-06-22 11:47:17 +00:00
|
|
|
|
2021-06-22 11:25:14 +00:00
|
|
|
DROP TABLE IF EXISTS t1;
|