Create 02013_add_system_table_views.sql

This commit is contained in:
OnePiece 2021-08-24 20:14:01 +08:00 committed by GitHub
parent adefa73b73
commit 7f72e51a8f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -0,0 +1,8 @@
DROP TABLE IF EXISTS table_views_test;
CREATE TABLE table_views_test (a UInt8, s String) ENGINE = MergeTree() ORDER BY a;
DROP TABLE IF EXISTS table_views_test_view;
CREATE MATERIALIZED VIEW table_views_test_view ENGINE = ReplacingMergeTree() ORDER BY a AS SELECT * FROM table_views_test;
SELECT * FROM system.table_views WHERE view_table = 'table_views_test_view';
DROP TABLE IF EXISTS table_views_test_view;
SELECT * FROM system.table_views WHERE view_table = 'table_views_test_view';
DROP TABLE IF EXISTS table_views_test;