Reputation:
I am getting this error when i try to delete the records of the first table, where the ID of this table does not exist in the records of the second table?
delete APP_LOG
from APP_LOG
left join APP_AUDIT on APP_LOG.ID = APP_AUDIT.LOG_ID
where APP_AUDIT.ID is null
Upvotes: 2
Views: 144
Reputation: 164139
This syntax is not supported by Oracle.
You can do it with NOT EXISTS
:
DELETE FROM APP_LOG al
WHERE NOT EXISTS (
SELECT 1
FROM APP_AUDIT aa
WHERE al.ID = aa.LOG_ID
)
Upvotes: 2