MySQL Multi-Delete. Is it possible to multi-delete referenced rows?
问题 If I have a parent table and a child table, is it possible to multi-delete the rows in them without having a "ON DELETE CASCADE" constraint? In this example: create table a(id int primary key); create table b(id int primary key, a_id int, constraint fkb foreign key (a_id) references a(id)); Is it not possible to do something like this in order to delete rows in tables a and b? :-( delete a, b from b inner join a on a.id = b.a_id where a.id = ?; Error Code: 1451. Cannot delete or update a