mysql复制一个表的数据到已存在的表中(可夸数据库实例)
复制全部数据
INSERT INTO database1.table1 SELECT * FROM database2.table2;
复制存在于table2不存在于table1的数据
INSERT INTO database1.table1 a SELECT b.* FROM database2.table2 b WHERE a.id NOT IN (SELECT id FROM database2.table2)
INSERT INTO database1.table1 SELECT * FROM database2.table2;
INSERT INTO database1.table1 a SELECT b.* FROM database2.table2 b WHERE a.id NOT IN (SELECT id FROM database2.table2)