I have a MySQL database, with one table that has a primary key, f_id
that is referenced in multiple table as a foreign key.
I want to delete all records where f_id
is a specific value from all referenced tables in a single batch.
I am attempting to delete a specific f_id
record in the primary table, however I cannot since there are records present in the referenced tables containing that f_id
value.
How can I delete all related records at once without having to hand-write a query for each and every related table?