MySQL triggers: after an update on table1, delete rows from table2? -
after update on table1, want delete data in table2. however, delete data in table2 need example, id can obtained update on table1. how can this?
table1 : table1_id pk, column1, column2 table2 : table2_id pk, table1_id fk, column 1
wabbit, 1 should you:
delimiter /// create trigger name_of_the_trigger after update on table1 each row begin delete table2 t2 t2.table1_id = old.table1_id; end; /// delimiter ;
Comments
Post a Comment