With SQL, you can copy information from one table into another.
The SELECT INTO statement copies data from one table and inserts it into a new table.
The SELECT INTO statement selects data from one table and inserts it into a new table.
We can copy all columns into the new table:
Or we can copy only the columns we want into the new table:
The new table will be created with the column-names and types as defined in the SELECT statement. You can apply new names using the AS clause.
Create a backup copy of Customers:
Use the IN clause to copy the table into another database:
Copy only a few columns into the new table:
Copy only the German customers into the new table:
Copy data from more than one table into the new table:
Tip: The SELECT INTO statement can also be used to create a new, empty table using the schema of another. Just add a WHERE clause that causes the query to return no data: