日期:2014-05-18  浏览次数:20569 次

判断多数据存在于多数据?
表A 有100条记录
表B 有100000000条记录

插入表B中没有的表A记录
更新表B中 存在表A的记录

------解决方案--------------------
insert into b(t) select a.t from a,b where b.t(+)=a.t and b.t is null
------解决方案--------------------
SQL code
表A 有100条记录 
表B 有100000000条记录 

插入表B中没有的表A记录 
更新表B中 存在表A的记录
-----------------------------------------------
insert into b select * from a where id not in (select id from b)
update b set col = a.col from b,a where a.id = b.id