ClickHouse/tests/queries/0_stateless/00635_shard_distinct_order_by.sql

9 lines
314 B
MySQL
Raw Normal View History

2019-06-07 15:41:24 +00:00
DROP TABLE IF EXISTS data;
CREATE TABLE data (s String, x Int8, y Int8) ENGINE = MergeTree ORDER BY tuple();
2018-05-31 18:28:47 +00:00
2019-06-07 15:41:24 +00:00
INSERT INTO data VALUES ('hello', 0, 0), ('world', 0, 0), ('hello', 1, -1), ('world', -1, 1);
2018-05-31 18:28:47 +00:00
2019-06-07 15:41:24 +00:00
SELECT DISTINCT s FROM remote('127.0.0.{1,2}', currentDatabase(), data) ORDER BY x + y, s;
2018-05-31 18:28:47 +00:00
2019-06-07 15:41:24 +00:00
DROP TABLE data;