不需要存储过程,把两个INSERT放在同一事物处理就可以了。 insert into c as select * from a where a.id not in(select id from b) insert into c as select * from b where b.id not in(select id from a)
insert into C select * from A where A.id not in (select B.id from B);insert into C select * from B where B.id not in (select A.id from A);
大概是这样的吧: insert c (select * from a where a.* not in(select * from b)) insert c (select * from b where b.* not in(select * from a))
insert into c as select * from a where a.id not in(select id from b)
insert into c as select * from b where b.id not in(select id from a)
insert c (select * from a where a.* not in(select * from b))
insert c (select * from b where b.* not in(select * from a))