这是我的 oracle 查询:
SELECT DISTINCT Student.student_id, student_name, SUM(credit)
FROM Student, Class, Enrolls
WHERE Student.student_id = Enrolls.student_id
AND Class.schedule_num = Enrolls.schedule_num
AND Class.semester = Enrolls.semester
AND grade != 'F'
AND grade IS NOT null
ORDER BY student_id ASC;
查询工作正常,直到我添加SUM(credit)
. 之后我得到:
ORA-00937: not a single-group group function
请帮忙,谢谢。