2018-10-17 06:35:16 +00:00
|
|
|
DROP TABLE IF EXISTS test.test;
|
|
|
|
DROP TABLE IF EXISTS test.test_view;
|
|
|
|
DROP TABLE IF EXISTS test.test_nested_view;
|
|
|
|
DROP TABLE IF EXISTS test.test_joined_view;
|
|
|
|
|
|
|
|
USE test;
|
|
|
|
CREATE VIEW test AS SELECT 1 AS N;
|
|
|
|
CREATE VIEW test_view AS SELECT * FROM test;
|
|
|
|
CREATE VIEW test_nested_view AS SELECT * FROM (SELECT * FROM test);
|
2019-01-24 14:22:58 +00:00
|
|
|
CREATE VIEW test_joined_view AS SELECT *, N AS x FROM test ANY LEFT JOIN test USING N;
|
2018-10-17 06:35:16 +00:00
|
|
|
|
|
|
|
SELECT * FROM test_view;
|
|
|
|
SELECT * FROM test_nested_view;
|
|
|
|
SELECT * FROM test_joined_view;
|
|
|
|
|
|
|
|
USE default;
|
|
|
|
SELECT * FROM test.test_view;
|
|
|
|
SELECT * FROM test.test_nested_view;
|
|
|
|
SELECT * FROM test.test_joined_view;
|
|
|
|
|
|
|
|
DROP TABLE IF EXISTS test.test;
|
|
|
|
DROP TABLE IF EXISTS test.test_view;
|
|
|
|
DROP TABLE IF EXISTS test.test_nested_view;
|