MySQL Insert & Joins

后端 未结 3 1472
庸人自扰
庸人自扰 2020-11-30 06:40

i saw this

In MySQL, joins work for INSERT, UPDATE, and DELETE statements. It\'s possible to change data in more than one table when joining ta

3条回答
  •  栀梦
    栀梦 (楼主)
    2020-11-30 07:18

    To complete the set, here's one for DELETE. This is a common method for deleting rows together with their dependencies without triggers.

    DELETE users, comments
    FROM users JOIN comments ON comments.author=users.id
    WHERE users.isspammer=1
    

提交回复
热议问题