如果要删的是A表
DELETE FROM A WHERE A.ID IN (SELECT DISTINCT ID FROM B) AND A.DATE<=TO_DATE('20001231','yyyymmdd');如果要删B表你稍微修改一下就好了,不过这个删除过程效率不太高,效率高的还没想到,想到了再贴出来

解决方案 »

  1.   

    delete a from b where a.id=b.id and a.date<=to_date('20001231','yyyymmdd')
      

  2.   

    楼上的测试过吗?可以在where中使用exist
      

  3.   

    这个可能效率高些:
    delete a where a.date<=to_date('20001231','yyyymmdd') and exists
    (select null from b where a.id=b.id);
      

  4.   

    delete a where a.date<=to_date('20001231','yyyymmdd') and a.id in(select id from b)
      

  5.   

    delete from a where exists(select 1 from b where a.id=b.id) and a.date<=to_adte
      

  6.   

    tmd,结不了帐,老是error page
    明天再来结分
      

  7.   

    delete a from where a.date<=to_date('2000-12-31','yyyy-mm-dd') and a.id in(select id from b)