mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-05 14:02:21 +00:00
97f2a2213e
* Move some code outside dbms/src folder * Fix paths
16 lines
425 B
SQL
16 lines
425 B
SQL
DROP TABLE IF EXISTS test1;
|
|
DROP TABLE IF EXISTS test2;
|
|
DROP TABLE IF EXISTS mv;
|
|
|
|
CREATE TABLE test1 (a UInt8, b String) ENGINE MergeTree ORDER BY a;
|
|
CREATE TABLE test2 (c UInt8, d String) ENGINE MergeTree ORDER BY c;
|
|
CREATE MATERIALIZED VIEW mv TO test1 (b String, a UInt8) AS SELECT d AS b, c AS a FROM test2;
|
|
|
|
INSERT INTO test2 VALUES (1, 'test');
|
|
|
|
SELECT * FROM test1;
|
|
|
|
DROP TABLE test1;
|
|
DROP TABLE test2;
|
|
DROP TABLE mv;
|