oracle多表关联删除数据表记录方法

oracle多表关联删除的两种方法

第一种使用exists方法

  1. delete  
  2. from tableA  
  3. where exits  
  4. (  
  5.      select 1  
  6.      from tableB  
  7.      Where tableA.id = tableB.id  
  8. )  

第二种使用匿名表方式进行删除
  1. delete  
  2. from  
  3. (  
  4.       select 1  
  5.       from tableA,TableB  
  6.       where tableA.id = tableB.id  
  7. )  
 
 
posted @ 2015-12-01 09:15  java高级技术汇  阅读(3363)  评论(0编辑  收藏  举报