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
INTO
clause is logically applied last in processing, after theORDER BY
andLIMIT
clauses. -
Teiid Spring Boot’s support for
SELECT INTO
is similar to Microsoft SQL Server. The target of theINTO
clause is a table where the result of theSELECT
command will be inserted.For example, the following statement:
SELECT col1, col2 INTO targetTable FROM sourceTable
inserts
col1
andcol2
from thesourceTable
into thetargetTable
. -
You cannot combine SELECT INTO with a UNION query.
That is, you cannot select the results from a
sourceTable UNION
query for insertion into atargetTable
.