我是新來的MySQL所以請告訴我,如果我的問題是缺少信息,ERROR 1052(23000):在where子句是不明確的列「COURSE_ID」
我有工作正常的查詢:
select au.email, sm.created, sm.grade, sm.max_grade
from auth_user au, courseware_studentmodule sm
where sm.student_id = au.id
and course_id = 'MyCourse'
and sm.module_type = 'problem';
但是,當我想從一個不同的表中添加另一列:
select au.email, sm.created, sce.created , sm.grade, sm.max_grade
from auth_user au, courseware_studentmodule sm, student_courseenrollment sce
where sm.student_id = au.id and sm.student_id = sce.id
and course_id = 'MyCourse'
and sm.module_type = 'problem';
我得到這個錯誤
ERROR 1052 (23000): Column 'course_id' in where clause is ambiguous
任何人都知道爲什麼?
感謝
可能重複:// stackoverflow.com/questions/17029096/how-to-fix-an-ambigous-column-name-error-using-inner-join-error) – Ben