我将外键创建为ON DELETE RESTRICT,但有时需要在删除父记录的同时删除子记录。我不能使用"ON DELETE CASCADE“,因为我更需要那个限制。delete * from table1 where ID='3' CASCADE CHILD; 或 delete * from table1 where ID='3' SET foreign_key_behavior
TABLE1 (Primary Key ID)3.TABLE3 (ID Foreign key reference from TABLE1)5.TABLE5 (ID Foreign key reference from TABLE1)
最重要的是,5个表都有大量的数据。我知道如果我把外键从所有的子表中