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

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

第一种使用exists方法

delete
from tableA
where exits
(
     select 1
     from tableB
     Where tableA.id = tableB.id
)


第二种使用匿名表方式进行删除

delete
from
(
      select 1
      from tableA,TableB
      where tableA.id = tableB.id
)


这种方法只适合两个表都有主键或外键的时候,若是关联一个管道函数就无法删除成功,会提示错误

原文地址:https://www.cnblogs.com/wala-wo/p/5119318.html