user13768246
user13768246

Reputation:

ORACLE APEX Deleting rows with LEFT JOIN

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

enter image description here

Upvotes: 2

Views: 144

Answers (1)

forpas
forpas

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

Related Questions