------解决方案-------------------- delete from A where exists(select 1 from B where A.id=B.id and (A.starttime>B.endtime or A.endtime<B.starttime));
------解决方案-------------------- delete from A where exists(select 1 from B where A.id=B.id and (A.starttime>B.endtime or A.endtime<B.starttime));
从A中取出来每一条数据和B比较 如果存在 则删除
------解决方案-------------------- delete from A where NOT exists (select 1 from B where A.id=B.id and A.starttime<B.endtime AND A.endtime>B.starttime);
------解决方案--------------------