0

这就是我所拥有的;

SELECT course.course_no, enrollment.grade, 
FROM course, enrollment, course_section, student
WHERE course.course_no=course_section.course_no, 
course_section.c_sec_id=enrollment.c_sec_id, enrollment.s_id=student.s_id
AND student.s_first='Tammy', student.s_last='Jones';


FROM course, enrollment, course_section, student    
ERROR at line 2:
ORA-00936: missing expression
4

3 回答 3

1

你在最后一列之后还有一个额外的逗号,在你的 where 子句中,你应该使用 AND 而不是 COMMA 试试这个

SELECT course.course_no, enrollment.grade
FROM course, enrollment, course_section, student
WHERE course.course_no=course_section.course_no AND  
course_section.c_sec_id=enrollment.c_sec_id AND 
enrollment.s_id=student.s_id AND 
student.s_first='Tammy' AND 
student.s_last='Jones';
于 2014-04-10T18:55:26.317 回答
1

使用AND而不是,WHEREcaluse。还要从SELECT语句中删除最后一个额外的逗号。

SELECT course.course_no, enrollment.grade
FROM   course, 
       enrollment, 
       course_section, 
       student
WHERE  course.course_no = course_section.course_no        
AND    course_section.c_sec_id=enrollment.c_sec_id        
AND    enrollment.s_id=student.s_id
AND    student.s_first='Tammy'
AND    student.s_last='Jones';
于 2014-04-10T18:55:59.020 回答
0

您的 WHERE 子句格式不正确。

当 WHERE 子句有多个部分时,必须明确说明它们,而不仅仅是用逗号分隔:

SELECT course.course_no, enrollment.grade, 
FROM course, enrollment, course_section, student
WHERE course.course_no=course_section.course_no
AND course_section.c_sec_id=enrollment.c_sec_id
AND   enrollment.s_id=student.s_id
AND student.s_first='Tammy'
AND student.s_last='Jones';
于 2014-04-10T18:55:38.083 回答