I want a trigger to DELETE from 2 tables in MySQL

后端 未结 5 1683
渐次进展
渐次进展 2020-12-10 13:16

I have 3 MySQL tables (food, apple, and orange).

I want to delete rows from:

apple(idapple, iduser, name) 
ora         


        
5条回答
  •  长情又很酷
    2020-12-10 14:04

    Something simpler maybe?

    DELETE f,a,o FROM
    food AS f 
    LEFT JOIN apple AS a USING (iduser)
    LEFT JOIN orange AS o USING (iduser)
    WHERE f.name = ...
    

    No trigger needed.

提交回复
热议问题