sql ,表A(ID, Code),表B(ID, Code),删除A中不在B中的记录
发布网友
发布时间:2024-10-24 15:02
我来回答
共2个回答
热心网友
时间:2024-10-29 08:11
delete from A
where exists(select * from B where B.id=A.id and B.code!=A.dode)
热心网友
时间:2024-10-29 08:09
delete A from tableA A
where not exists( select 1 from tableB A where (A.ID=B.ID) )