工作我已被接合並且左以下查詢加入:子查詢刪除未在Oracle
select aad.id
from [table1] aad
left outer join [table2] itm
on aad.table2_id = itm.id
left outer join [table3] eac
on aad.id = eac.table1_id
LEFT JOIN [table4] ces
ON eac.car_id = ces.id
LEFT join [table5] ci
on ces.car_information_id = ci.id
INNER join [table6] groupBi
on aad.capatibilty_degree_group_id = groupBi.id
where ces.id is null
and aad.depot_ammu_estimate = 123
上述查詢的結果是:
id
-----
2433
2431
IDS [表1]表中的( aad.id),那麼我想刪除該表的這個記錄,然後我的查詢語法如下:
delete
FROM [table1] w
where w.id in (select aad.id
from [table1] aad
left outer join [table2] itm
on aad.table2_id = itm.id
left outer join [table3] eac
on aad.id = eac.table1_id
LEFT JOIN [table4] ces
ON eac.car_id = ces.id
LEFT join [table5] ci
on ces.car_information_id = ci.id
INNER join [table6] groupBi
on aad.capatibilty_degree_group_id = groupBi.id
where ces.id is null
and aad.depot_ammu_estimate = 123)
它是什麼發生,沒有REC ords刪除。我不知道上述查詢不會刪除記錄。
Mayby更換
ces.id is null
您已經刪除,但沒有提交/回滾更改? –沒有這條記錄exists.i我不是初學者 –
應該工作正常。 Like被評論,你可能沒有正確地檢查結果或沒有提交,等等。如果你想得到進一步的幫助,請提供一個最小但完整的腳本,我們可以用它來重現你的問題。 – sstan