I have very much similar kind of requirement as described in this question.
Rank users in mysql by their points
The only difference is in my data. The above problem has the data where table has only row per student. But in my case there may be a possibility that table contains multiple rows for a single student like this
- Student 1 points 80
- Student 2 points 77.5
- Student 2 points 4.5
- Student 3 points 77
- Student 4 points 77
So now rank should be calculated based on the SUM
of points (total) that user has. So in this case result would be.
- Student 2 Rank 1 with 82 points
- Student 1 Rank 2 with 80 points
- Student 3 Rank 3 with 77 points
- Student 4 Rank 3 with 77 points
I tried couple of things with the solution of above question but couldn't get the result. Any help would be appreciated.