statement ok CREATE TABLE test (x INT, y INT); statement ok INSERT INTO test VALUES (1, 1), (2, 2), (1, 1), (3, 3); query II SELECT DISTINCT * FROM test ORDER BY x; ---- 1 1 2 2 3 3 query I SELECT DISTINCT sum(x) FROM test ORDER BY sum(x); ---- 7 # ORDER BY items must appear in the select list # if SELECT DISTINCT is specified statement error SELECT DISTINCT x FROM test ORDER BY y;