ClickHouse/tests/queries/0_stateless/01470_test_insert_select_asterisk.sql
2024-05-30 19:41:08 +00:00

19 lines
863 B
SQL

DROP TABLE IF EXISTS insert_select_dst;
DROP TABLE IF EXISTS insert_select_src;
CREATE TABLE insert_select_dst (i int, middle_a int, middle_b int, j int) ENGINE = Log;
CREATE TABLE insert_select_src (i int, j int) ENGINE = Log;
INSERT INTO insert_select_src VALUES (1, 2), (3, 4);
INSERT INTO insert_select_dst(* EXCEPT (middle_a, middle_b)) SELECT * FROM insert_select_src;
INSERT INTO insert_select_dst(insert_select_dst.* EXCEPT (middle_a, middle_b)) SELECT * FROM insert_select_src;
INSERT INTO insert_select_dst(COLUMNS('.*') EXCEPT (middle_a, middle_b)) SELECT * FROM insert_select_src;
INSERT INTO insert_select_dst(insert_select_src.* EXCEPT (middle_a, middle_b)) SELECT * FROM insert_select_src; -- { serverError UNKNOWN_IDENTIFIER }
SELECT * FROM insert_select_dst;
DROP TABLE IF EXISTS insert_select_dst;
DROP TABLE IF EXISTS insert_select_src;