I have 9 subjectcode, in which every subjectcode contains the subquestions as follows.Here question 1-7 contains 12 sub questions, and 8 contains 10 subquestions, and question 9 contains 8 sub-questions, where max score that can be obtained for per subquestion is 100
and max score that can be obtained for subjectcode 1-7 is 1200, 8 is 1000 and 9 is 800.
To calculate average of subjectcode i am writing
select subjectcode,sum(totalscore)/count(*)*12 from t
group by subjectcode
Here totalscore is the totalscore of all subquestions in everysubject.
But i want this query to return a single recordset with subjectcode 8 to be divided by 10 and 9 to be divided by 8.