I have a select within my query used for sum and every time I add the GRADE field of table PA_XCPNT_EVTHST.GRADE, I get the error ORA-00907. If I remove the select grid, it works perfectly. This is the original select:
( SELECT SUM( SCORE ) FROM QUIZ_DETAILS Q1 WHERE Q1.STUD_ID = QUIZ_DETAILS.STUD_ID
AND Q1.RN = '1' GROUP BY Q1.STUD_ID ) AS SOMA_SCORE
This was the select after my change (which I'm not sure is correct):
( SELECT SUM( SCORE + GRADE ) FROM QUIZ_DETAILS Q1 DADOS D1 WHERE Q1.STUD_ID = QUIZ_DETAILS.STUD_ID D1.STUD_ID = DADOS.STUD_ID
AND Q1.RN = '1' GROUP BY Q1.STUD_ID ) AS SOMA_SCORE
Can you help me?