I have the following table:
| WinnerID | LoserID |
It describes the result of a match between two competitors. Currently, I have the following query for generating a high score:
SELECT WinnerID
FROM KomperResult
GROUP BY WinnerID
ORDER BY COUNT(LoserID) DESC LIMIT 10;
If the results were:
| WinnerID | LoserID |
1 2
1 3
4 1
The high score would be:
1
4
But I want it to be:
4
1
What would be a better algorithm / query for generating the high score?