MySQL Merging Two Identical Tables
The problem is that a straight * insertion will fail because of the primary keys which are likely to clash.
The solution is specifically mention all the the other fields
INSERT INTO table_1(col2, col3, col4) SELECT col2, col3, col4 FROM table_2;
The primary key of table_1 should be auto_increment .
The solution is specifically mention all the the other fields
INSERT INTO table_1(col2, col3, col4) SELECT col2, col3, col4 FROM table_2;
The primary key of table_1 should be auto_increment .
Labels: Merging tables

0 Comments:
Post a Comment
<< Home