I have to delete rows from guide_category that have no relation with guide table (dead relations).
guide_category
guide
Here is what I want to do, but it of cou
I think, from your description, the following would suffice:
DELETE FROM guide_category WHERE id_guide NOT IN (SELECT id_guide FROM guide)
I assume, that there are no referential integrity constraints on the tables involved, are there?