56,687
社区成员
发帖
与我相关
我的任务
分享
//b没有
insert into c select * from a where id not in (select id from b)
//b有
insert into c select * from a where id in (select id from b)
insert into c select a.* from a where a.id not in (select id from b)
根据你的意思应该是这样!insert into C
select A.* from A left join B on a.id=b.id
where b.id is null