The 'SELECT INTO' statement in SQL is used to create a new table from an existing table. It copies data from one table and inserts it into a new table.

The syntax for the statement is as follows:

SELECT column1, column2, ...
INTO new_table
FROM existing_table
WHERE condition;

Here, 'column1, column2, ...' are the columns you want to copy from the existing table to the new table. 'new_table' is the name of the new table that will be created. 'existing_table' is the name of the table from which the data will be copied. 'condition' is an optional clause used to filter the data that will be copied.

Note that the 'SELECT INTO' statement is only used to create a new table. If you need to insert data into an existing table, you should use the 'INSERT INTO' statement instead.

SQL SELECT INTO Statement: Create a New Table from Existing Data

原文地址: https://www.cveoy.top/t/topic/mI1v 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录