Given the following rows of course,section,grade,count of grades within course section:
course SECTION grade gradeCount
-----------------------------------
1301 001 C 3
1301 001 C+ 3
1301 001 C- 4
1301 001 D 5
1301 001 D+ 3
1301 001 D- 2
1301 001 F 18
1301 002 A- 1
1301 002 B 1
1301 002 B- 3
1301 002 C 2
I want to get a list of course/sections with the greatest number of each grade.
For example:
Grade|Course|Section|Count
A | 1301| 023 | 75 // 1301-023 had the most A's, 75 of them
B | 1301| 033 | 65 // 1301-033 had the most B's, 65 of them
Ties should appear in the list.