mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 07:01:59 +00:00
19 lines
592 B
SQL
19 lines
592 B
SQL
DROP TABLE IF EXISTS t;
|
|
DROP TABLE IF EXISTS d;
|
|
|
|
CREATE TABLE t (a String, b Int) ENGINE = TinyLog;
|
|
INSERT INTO t VALUES ('a', 0), ('a', 1), ('b', 0);
|
|
SELECT * FROM t;
|
|
|
|
SELECT '---';
|
|
CREATE TABLE d (a String, b Int) ENGINE = Distributed(test_shard_localhost, currentDatabase(), t);
|
|
SELECT DISTINCT b FROM (SELECT a, b FROM d GROUP BY a, b) order by b;
|
|
DROP TABLE d;
|
|
|
|
SELECT '---';
|
|
CREATE TABLE d (a String, b Int) ENGINE = Distributed(test_cluster_two_shards_localhost, currentDatabase(), t);
|
|
SELECT DISTINCT b FROM (SELECT a, b FROM d GROUP BY a, b) order by b;
|
|
DROP TABLE d;
|
|
|
|
DROP TABLE t;
|