Subqueries In INSERT Requests - Teradata Database

SQL Data Manipulation Language

Product
Teradata Database
Release Number
15.10
Language
English (United States)
Last Update
2018-10-06
dita:id
B035-1146
lifecycle
previous
Product Category
Teradata® Database

Subqueries In INSERT Requests

An INSERT operation that uses a subquery, referred to as an INSERT … SELECT request, differs from a simple INSERT in that many rows can be inserted in a single operation, and the row values can come from more than one table.

The query specification must always include a FROM table_name clause.

Also, an INSERT request that includes a subquery must define a column name list when the following conditions exist:

  • The number of columns listed in the query specification differs from the number of columns in the table receiving new rows.
  • The order of columns listed in the query specification differs from the order the columns were defined in the table receiving new rows.
  • Also see “Using Scalar Subqueries in INSERT Requests” on page 362.