ClickHouse/tests/queries/0_stateless/01917_distinct_on.sql

12 lines
312 B
MySQL
Raw Normal View History

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;
SELECT DISTINCT ON (a, b) a, b, c FROM t1 LIMIT BY 1; -- { serverError 588 }
DROP TABLE IF EXISTS t1;