I delete the selected rows from both tables in MYSQL, the two tables have foreign keys. delete d, b from A as b is the inner join of B as d on b.bid = d.bid where b.name is like '% xxxx%';
MYSQL complains about foreign keys, although I am trying to remove from both tables:
Error: cannot delete or update parent line: foreign key constraint ends with an error ( yyy/d, CONSTRAINT fk_d_bidFOREIGN KEY ( bid) LINKS b( bid) ON DELETE NO UPDATE ACTIONS NO ACTIONS)
what is the best solution here to remove from both tables?
source
share