日期:2018-07-23
delete from biblios b where not exists(select from holding where bookrecno=b.bookrecno) and not exists(select from book_check where bookrecno=b.bookrecno) and not exists(select from book_order where bookrecno=b.bookrecno) and not exists(select from ser_check where bookrecno=b.bookrecno) and not exists(select * from ser_order where bookrecno=b.bookrecno); ---如果数据量少可以一次性删除。
commit;
delete from biblios b where not exists(select from holding where bookrecno=b.bookrecno) and not exists(select from book_check where bookrecno=b.bookrecno) and not exists(select from book_order where bookrecno=b.bookrecno) and not exists(select from ser_check where bookrecno=b.bookrecno) and not exists(select * from ser_order where bookrecno=b.bookrecno) and rownum<10000;
commit; ---如果数据量大,10000条处理一次 循环处理。