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
)
這種方法只適合兩個表都有主鍵或外鍵的時候,若是關聯一個管道函數就無法刪除成功,會提示錯誤