The SELECT INTO statement is used to select data from a SQL database table and to insert it to a different table at the same time.
The general SELECT INTO syntax looks like this:
|
SELECT Column1, Column2, Column3,
INTO Table2 FROM Table1 |
The list of column names after the
SELECT command determines which columns will be copied, and the table name
after the SQL INTO keyword specifies to which table to copy those rows.
If we want to make an exact copy of
the data in our Customers table, we need the following SELECT INTO
statement:
|
SELECT *
INTO Customers_copy FROM Customers |
No comments:
Post a Comment