MySQL 连表删除

如果需要通过父级表的条件确定本表被删除的数据内容,则需要用到如下连表删除语法

实现方式

1
2
3
4
5
6
7
8
DELETE 
	sqo
FROM
	pt_survey_question_option sqo,
	pt_survey_question sq
WHERE
	sqo.question_id = sq.id AND
	sq.survey_id = 4