Hi there,
I'm trying to write a query that will list student(s) enrolled with the maximum total credit points.
Here is my query:
select s.S_ID, s.S_LAST, s.S_FIRST, s."Total Credits"
from (select q2.S_ID, q2.S_LAST, q2.S_FIRST, sum(q1.CREDITS) "Total Credits" from (select COURSE_NO, CREDITS from COURSE) q1 join
(select s.S_ID, s.S_LAST, s.S_FIRST, cs.COURSE_NO
from STUDENT s join ENROLLMENT e on s.S_ID = e.S_ID join COURSE_SECTION cs on e.C_SEC_ID = cs.C_SEC_ID) q2 on q1.COURSE_NO = q2.COURSE_NO
group by q2.S_ID, q2.S_LAST, q2.S_FIRST) q3
group by s.S_ID, s.S_LAST, s.S_FIRST, s."Total Credits"
where "Total Credits" = max("Total Credits");
Doesn't seem to be working, this is the error:
ORA-00933: SQL command not properly ended
00933. 00000 - "SQL command not properly ended"
*Cause:
*Action:
Error at Line: 23 Column: 1
Would appreciate any help possible