DELETE posts.* FROM posts p LEFT JOIN anderetabelle a ON p.post_id=a.post_id WHERE a.post_id IS NULL;