Developing By Me

Project Development and Design

INSERT INTO SELECT

    The INSERT INTO SELECT is a mix of the INSERT INTO and SELECT statements. The statement allows the DBA to use data from an existing table to update an existing one. Normally the INSERT statement uses data from a user provided set of criteria however through this statement it is possible to build a table from other tables. This is an extension using a subquery however it is not uncommon and should be understood as it could be found in automated scripts. The following is the basic syntax for the INSERT INTO SELECT statement.

 

INSERT INTO table1
SELECT field1, field2, field3
FROM table2

 

%d bloggers like this: