我有一个调查表格,想要删除与特定调查相关的所有记录。
我的表格:
_______________ _______________ ___________ ________________
|_tblSurvey___| |_tblAnswers___| |_tblAlt__| |_tblQuestions_|
| surveyID | | answerAltID | | altID | | questID |
| surveyName | | userID | | altText | | questText |
|_____________| |______________| |_questID_| |_surveyID_____|
假设我想删除所有与调查ID 1 相关的记录。
我尝试了以下操作:
DELETE
*
FROM tblSurvey, tblQuestions, tblAlt, tblAnswers
WHERE tblSurvey.surveyID = 1
AND tblsurvey.surveyID = tblQuestions.surveyID
AND tblQuestions.questID = tblAlt.questID
AND tblAlt.altID = tblAnswers.answerAltID