ClickHouse/tests/queries/0_stateless/00740_database_in_nested_view.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

28 lines
929 B
SQL

CREATE DATABASE test_00740;
USE test_00740;
DROP TABLE IF EXISTS test_00740;
DROP TABLE IF EXISTS test_view_00740;
DROP TABLE IF EXISTS test_nested_view_00740;
DROP TABLE IF EXISTS test_joined_view_00740;
CREATE VIEW test_00740 AS SELECT 1 AS N;
CREATE VIEW test_view_00740 AS SELECT * FROM test_00740;
CREATE VIEW test_nested_view_00740 AS SELECT * FROM (SELECT * FROM test_00740);
CREATE VIEW test_joined_view_00740 AS SELECT *, N AS x FROM test_00740 ANY LEFT JOIN test_00740 USING N;
SELECT * FROM test_view_00740;
SELECT * FROM test_nested_view_00740;
SELECT * FROM test_joined_view_00740;
USE default;
SELECT * FROM test_00740.test_view_00740;
SELECT * FROM test_00740.test_nested_view_00740;
SELECT * FROM test_00740.test_joined_view_00740;
DROP TABLE IF EXISTS test_00740.test_00740;
DROP TABLE IF EXISTS test_00740.test_view_00740;
DROP TABLE IF EXISTS test_00740.test_nested_view_00740;
DROP DATABASE test_00740;