merging-rows

Merging rows from two databases

I have two (or more) different databases, identically structured but each containing different data. How would I go about merging the data of one database into the other? This is a harder problem than I first thought. I have a table with primary keys, so a simple INSERT INTO db1.table1 SELECT * FROM db2.table1 may fail with clashing p...