I am trying to INSERT INTO
a table using the input from another table. Although this is entirely feasible for many database engines, I always seem to struggle to remember the correct syntax for the SQL
engine of the day (MySQL, Oracle, SQL Server, Informix, and DB2).
Is there a silver-bullet syntax coming from an SQL standard (for example, SQL-92) that would allow me to insert the values without worrying about the underlying database?
This is another example using values with select:
Simple insertion when table column sequence is known:
Simple insertion mentioning column:
Bulk insertion when number of selected columns of a table(#table2) are equal to insertion table(Table1)
Bulk insertion when you want to insert only into desired column of a table(table1):
This worked for me:
The sentence is a bit different from Oracle's.
Best way to insert multiple records from any other tables.