Home > Back-end >  Trigger a cascading delete
Trigger a cascading delete

Time:09-21

An order table order_ and a schedule of orders orderitem
When you want to delete the order table order_ table at the same time to delete the order of all order details
Write a trigger but does couldn't identify
 DELETE orderitem 
The FROM
Orderitem
WHERE
Order_id IN (SELECT order_id FROM does)


Such mistakes (Err), 1146 - Table 'graduation_project. Does' doesn' t exist
Does mysql cannot use does keywords that should be how to modify the

CodePudding user response:

The field? Use ` ` field names (1 on the left side of the key) package
  • Related