First of all, we have to pay attention to types of values we are inserting in the table. Several examples try to insert values in wrong order.
Second of all, there is an INSERT INTO SELECT statement in SQL. It copies data from one table and inserts it into another one. It requires that data types in source and target tables match.
It has the following structure in general case:
INSERT INTO table1 (column1, column2, column3, ...)
SELECT column1, column2, column3, ...
FROM table2
WHERE condition;
but, as in regular INSERT statement, it allows omitting explicit columns specification in INSERT clause.
Login in to like
Login in to comment