INTO table FROM ...
INTO clause
|
Warning
|
Usage of the INTO Clause for inserting into a table has been been deprecated. An INSERT with a query command should be used instead. For information about using INSERT, see INSERT command. |
When the into clause is specified with a SELECT, the results of the query are inserted into the specified table. This is often used to insert records into a temporary table. The INTO clause immediately precedes the FROM clause.
-
The
INTOclause is logically applied last in processing, after theORDER BYandLIMITclauses. -
Teiid Spring Boot’s support for
SELECT INTOis similar to Microsoft SQL Server. The target of theINTOclause is a table where the result of theSELECTcommand will be inserted.For example, the following statement:
SELECT col1, col2 INTO targetTable FROM sourceTableinserts
col1andcol2from thesourceTableinto thetargetTable. -
You cannot combine SELECT INTO with a UNION query.
That is, you cannot select the results from a
sourceTable UNIONquery for insertion into atargetTable.