我有2个表(tblTrainingElements和tblCourses)。女士访问删除查询与加入和在哪里条款
tblTrainingElements具有以下字段: ([培训元素ID],[课程ID],[标题],[时间(min)],[患者],[状态],[描述],[意见],[网站],[ElementSeq])
tblCourses具有如下相关字段: [课程ID],[应用程序ID]
我需要删除tblTrainingElements其中发现的[所有记录App ID] from tblCourse = “CAD”。我需要加入[课程ID]字段中的表格。以下是我尝试使用的SQL语句。我不断收到错误消息“请指定您想从一个表删除”
DELETE tblCourses.[Course Name], tblCourses.[App ID], tblTrainingElements.[Training Element ID], tblTrainingElements.[Course ID], tblTrainingElements.Title, tblTrainingElements.[Duration (min)], tblTrainingElements.Patient, tblTrainingElements.Status, tblTrainingElements.Description, tblTrainingElements.Comments, tblTrainingElements.Site, tblTrainingElements.ElementSeq
FROM tblCourses INNER JOIN tblTrainingElements ON tblCourses.[Course ID] = tblTrainingElements.[Course ID]
WHERE (((tblCourses.[App ID])="CAD"))
删除查询不需要列名。它需要表名。 '删除{TableName}'。尝试这个。 –
感谢Chetan的回应。你能让我确切地知道包含什么吗?我想:。 'DELETE FROM tblTrainingElements INNER JOIN tblTrainingElements ON tblTrainingElements [课程ID] = tblCourses [课程ID] WHERE(((tblCourses [应用ID)= “CAD”))' 这并不工作 – Chuck0185