ORA-00918:为CourseID模糊定义的列

时间:2016-07-23 21:08:03

标签: oracle

select 
    grade.sectionid,
    grade.studentid,
    course.courseid
FROM grade, course, section
    INNER JOIN grade
            ON grade.sectionid = section.sectionid
    INNER JOIN course
            ON course.courseid = section.courseid;

继续收到错误: ORA-00918:列模糊定义

错误发生在course.courseid行

2 个答案:

答案 0 :(得分:0)

你在FROM中定义了两次课程,所以它不知道从哪一个提取信息。在FROM中为您的表格提供一些别名,以便您可以具体说明事物的来源,或者删除其中一个参考文件,如果您不想将其包含两次。

...
从成绩,课程,部分
...
INNER JOIN 课程
......

答案 1 :(得分:0)

SELECT
    grade.sectionid,
    grade.studentid,
    course.courseid
FROM section
    INNER JOIN grade
            ON grade.sectionid = section.sectionid
    INNER JOIN course
            ON course.courseid = section.courseid;