ORA-00907: missing right parenthesis error

0

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?

    
asked by anonymous 08.01.2018 / 18:16

1 answer

0

Since your second query is correct, I believe the error is that you did not put AND between the first and second condition of where . Try this:

(SELECT SUM( SCORE + GRADE )
   FROM QUIZ_DETAILS Q1 DADOS D1 
  WHERE Q1.STUD_ID = QUIZ_DETAILS.STUD_ID 
    AND D1.STUD_ID = DADOS.STUD_ID
    AND Q1.RN = '1' GROUP BY Q1.STUD_ID ) AS SOMA_SCORE
    
08.01.2018 / 18:24