使用
exists要继续处理到最低限度。
沿着这些思路进行了一些修改,以使联接正确(也请验证我没有做任何愚蠢的事情,
TableA并且
TableB从您的描述中得到来回的信息):
insert into TableB select * from TableA a where not exists (select 1 from TableB b where b.ID = a.ID)delete from TableB bwhere not exists (select 1 from TableA a where a.ID = b.ID)
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)