Insert into select
时间: 2023-07-04 17:28:28 浏览: 84
insert select与select into 的用法使用说明
"Insert into select" is a SQL statement used to insert data from one table to another.
The syntax for this statement is:
```
INSERT INTO table_name_1 (column1, column2, column3, ...)
SELECT column1, column2, column3, ...
FROM table_name_2
WHERE condition;
```
This statement selects data from `table_name_2` based on the `WHERE` condition (if specified) and inserts it into `table_name_1`. The columns in both tables should match in number and data type.
阅读全文