Tag Archives: insert

insert into table using a select from another table

Following the update with data from another table, i am leaving this for quick reference. To insert data into table2 from table2: insert into table2 (field1,field2,field3) select table1.field1,table1.field2,table1.field3 from table1 (all the above is on the same line) We can make this as complex as needed.

insert into table from a second table

Its simple but i thought of leaving it here if i forget (which is usually the case) how to do it again. If you want to insert the records from tableA into tableB, you do something like this: INSERT INTO tableA SELECT * FROM tableB You have to make sure all fields are the sameā€¦ Read More »