나는 설문 조사 용 테이블을 가지고 있으며 특정 서베이와 관련된 모든 레코드를 삭제하려고합니다.여러 테이블에서 관련된 모든 레코드 삭제
내 테이블 :
_______________ _______________ ___________ ________________
|_tblSurvey___| |_tblAnswers___| |_tblAlt__| |_tblQuestions_|
| surveyID | | answerAltID | | altID | | questID |
| surveyName | | userID | | altText | | questText |
|_____________| |______________| |_questID_| |_surveyID_____|
의 내가
surveyID 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
를 사용할 수있는 'tblQuestion'또는 'tblQuestions'라는 테이블인가? –
'tblQuestions'. 지금 편집되었습니다. – janlindso