I have 3 tables.
mainThas primary keymain_idsub1Thas foreign key tomain_idsub2Thas foreign key tomain_id
I need to delete all records from sub1T and sub2T in one SQL command.
I know how to delete all records inside sub1T using this command:
DELETE FROM `sub1T`
WHERE NOT EXISTS (SELECT NULL
FROM mainT
WHERE `mainT`.main_id = main_id)
I need to delete from multiple child tables