SQL多连接语句当我的SQL语句中只有一个内部联接时,它完美地工作了。我试着加入第二个表,现在我得到了一个错误,说明存在语法错误(缺少操作符)。这里怎么了?adsFormView.SelectCommand = "SELECT * FROM [tableCourse] INNER JOIN [tableGrade] ON [tableCourse].[grading] = [tableGrade].
[id] INNER JOIN [tableCourseType] ON [tableCourse].[course_type] = [tableCourseType].[id] WHERE [prefix]='" &
myPrefix & "' AND [course_number]='" & myCourseNum & "'"
3 回答
守候你守候我
TA贡献1802条经验 获得超10个赞
SELECT ...FROM ((origintableJOIN jointable1 ON ...)JOIN jointable2 ON ...)JOIN jointable3 ON ...
aluckdog
TA贡献1847条经验 获得超7个赞
MS Access(特别是Jet/ACE)需要带有多个联接的括号。试着:
adsFormView.SelectCommand = _
" SELECT * FROM ([tableCourse] " & _
" INNER JOIN [tableGrade] " & _
" ON [tableCourse].[grading] = [tableGrade].[id]) " & _
" INNER JOIN [tableCourseType] " & _
" ON [tableCourse].[course_type] = [tableCourseType].[id] " & _
" WHERE [prefix]='" & myPrefix & "'" & _
" AND [course_number]='" & myCourseNum & "'"
添加回答
举报
0/150
提交
取消