DELETE FROM content_to_tags
WHERE NOT EXISTS (
SELECT *
FROM content
WHERE content_id = content_to_tags.content_id
)
MySQL delete records in one table that do not exist in another table
This post brought to you by RocketGeek, ButlerBlog, and the following: