Insert from select
suggest changeYou can insert data in a table as the result of a select statement:
INSERT INTO person SELECT * FROM tmp_person WHERE age < 30;
Note that the projection of the select must match the columns required for the insert. In this case, the tmp_person
table has the same columns as person
.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents