The SQL 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 SQL SELECT INTO syntax looks like this:
SELECT Column1, Column2, Column3,
INTO Table2
FROM Table1
The list of column names after the SQL 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 SQL SELECT INTO statement:
SELECT *
INTO Customers_copy
FROM Customers
Popular Posts
-
The SQL SUM aggregate function allows selecting the total for a numeric column. The SQL SUM syntax is displayed below: SELECT SUM(Column1) F...
-
The SQL 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 g...
-
So far we’ve learnt how to select data from a database table and how to insert and update data into a database table. Now it’s time to learn...
-
IT professionals and students from all over the world have many options for SQL training nowadays. They can learn SQL by going to instructo...
-
The SQL AVG aggregate function selects the average value for certain table column. Have a look at the SQL AVG syntax: SELECT AVG(Column1) FR...
-
The SQL GROUP BY statement is used along with the SQL aggregate functions like SUM to provide means of grouping the result dataset by certai...
-
The SQL SELECT statement is used to select data from a SQL database table. This is usually the very first SQL command every SQL newbie learn...
-
The SQL MAX aggregate function allows us to select the highest (maximum) value for a certain column. The SQL MAX function syntax is very sim...
-
The SQL JOIN clause is used whenever we have to select data from 2 or more tables. To be able to use SQL JOIN clause to extract data from 2 ...
-
The SQL IN clause allows you to specify discrete values in your SQL WHERE search criteria. THE SQL IN syntax looks like this: SELECT Column1...
No comments:
Post a Comment