(1) INSERT [INTO] B SELECT id, field1, field2 FROM A WHERE NOT EXISTS (SELECT id FROM B WHERE id=[A.]id)
(2) INSERT [INTO] B SELECT * FROM A WHERE id NOT IN (SELECT id FROM B)
---------------------------------------------------------------------------
这两句,都是将 A 表中存在, 但B表中不存在的数据, 插入到B表中, 关联比较字段为 id.
但这两句的执行效率,却是有数量级的差别.
结论有两点: