ClickHouse/tests/queries/0_stateless/00984_materialized_view_to_columns.sql
Ivan 97f2a2213e
Move all folders inside /dbms one level up (#9974)
* Move some code outside dbms/src folder
* Fix paths
2020-04-02 02:51:21 +03:00

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;