INTO Clause
You are looking at an older version of the documentation. The latest version is found here.
SELECT INTO
When the INTO
clause is specified with a SELECT
, the query results are inserted into the specified table. The table will be created on SELECT INTO
processing and thus may not exist before execution. The INTO
clause immediately precedes the FROM
clause.
Usage
SELECT * INTO table FROM ...
Syntax Rules
- The
INTO
clause is logically applied last in processing, after theORDER BY
andLIMIT
clauses; - The Data Virtuality Server's support for
SELECT INTO
is similar to MS SQL Server. The target of theINTO
clause is a table where the result of the remainingSELECT
command will be inserted; SELECT INTO
should not be used with- set operations (
UNION
,INTERSECT
,EXCEPT
) - common table expressions (
WITH
)
- set operations (
INSERT INTO
When the INTO
clause is specified with an INSERT
, the query results are inserted into the specified table. The table will not be created on INSERT INTO
processing and thus must exist before execution. The INTO
clause immediately follows the INSERT
clause.
Usage
INSERT INTO table (column,...) VALUES (value,...)
-- or
INSERT INTO table (column,...) SELECT * FROM x