Oracle INSERT INTO SELECT Statement
In Oracle, INSERT INTO SELECT
statement allows you to insert complex records using SELECT statement. This statement is used to insert multiple elements.
Oracle INSERT INTO SELECT Syntax
To insert the complex records into the table, use the following syntax:
Syntax
INSERT INTO table_name1 ( col1, col2,...colN )
SELECT col1, col2,...colN
FROM table_name 2;
Oracle INSERT INTO SELECT example
The following Oracle statement to insert all the field values, either specify all field name or don't specify any field name.
Example
INSERT INTO tblCustomerLoan (firstName, lastName, address)
SELECT firstName, lastName, address
FROM tblCustomer
Note:
In the above example, we have inserted multiple records from "tblCustomer" table to "tblCustomerLoan" table using INSERT INTO SELECT statement.