I have a doubt similar to the question posted in the link SQL - columns for different categories. I have student table with Student Name, Midterm Grade and Final Grade as dipicted in GradeTable below.
StName MidTermGrade FinalGrade
St1 1 1
St2 2 1
St3 2 3
St4 1 3
St5 1 1
St6 2 3
St7 2 2
St8 1 1
St9 2 2
St10 2 3
St11 3 1
St12 2 1
St13 3 3
St14 3 2
St15 1 2
This data needs to be categorised using SQL query to generate the output so that all the grading and Student Names fall in one query output which i can paste in word/excel and provide it as report.
FinalGrade MidTermGrade1 MidTermGrade2 MidTermGrade3
1 St1 St2 St11
1 St5 St12
1 St8
2 St15 St7 St14
2 St9
3 St4 St3 St13
3 St6
3 St10
Please help and advise if this can be achieved.