Skip to main content
Skip table of contents

INTO Clause

SELECT INTO

When the INTO clause is specified with a SELECT, the results of the query 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

SQL
SELECT * INTO table FROM ...

Syntax Rules

  • The INTO clause is logically applied last in processing, after the ORDER BY and LIMIT clauses;
  • The Data Virtuality Server's support for SELECT INTO is similar to MS SQL Server. The target of the INTO clause is a table where the result of the remaining SELECT command will be inserted;
  • SELECT INTO should not be used with 
    • set operations (UNION, INTERSECT, EXCEPT)
    • common table expressions (WITH)

INSERT INTO

When the INTO clause is specified with an INSERT, the results of the query are inserted into the specified table. The table will not be created on INSERT INTO processing and thus must exist prior execution. The INTO clause immediately follows the INSERT clause.

Usage

SQL
INSERT INTO table (column,...) VALUES (value,...)
-- or
INSERT INTO table (column,...) SELECT * FROM x
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.