Insert into table with select statement

Sometimes you may need to populate a table (usually a temporary or new table) from data of another table (usually huge table).

Here’s is the statement that you may use

INSERT INTO “table1” (“column1”, “column2”, …)

SELECT “column3”, “column4”, …FROM “table2”

source

Leave a Reply

Your email address will not be published. Required fields are marked *