--因为不清楚具体你的哪些表,大概写一下--方法1,数据量不是很大insert into A(...) select * from B where not exists (select 1 from B where A.id=B.id)--假设id是主键或者唯一索引--方法2,写存储过程,每一千条commit一次,这个只是思路,代码是一样的