With following query I can find the data I want to delete:
SELECT ab.id, ab.anlage_id, a.id
FROM `anlagetobedienung` AS ab
LEFT JOIN anlage_new AS a ON ab.`anlage_id` = a.id
WHERE a.id IS NULL
How do I have to write the DELETE statement that deletes the found records in the anlagetobedienung table?
1 Answer