我是MySQL新手所以请告诉我,如果我的问题缺少信息,
我有一个工作正常的查询:
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';
Run Code Online (Sandbox Code Playgroud)
但是当我想从另一个表中添加另一个列时:
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';
Run Code Online (Sandbox Code Playgroud)
我收到这个错误
ERROR 1052 (23000): Column 'course_id' in where clause is ambiguous
Run Code Online (Sandbox Code Playgroud)
谁知道为什么?
谢谢