I have a function which tells the position a player have compared to others when it comes to number of finished maps.
The query below picks steamid and number if finished maps and sorts it with highest number first.
Code:
SELECT steamId,nFinished FROM `skillrank` ORDER BY nFinished DESC
Lets say I want to find out what position a certain player has in that total list.
Example. Queried player = STEAM_y:y:1111111
The result set contains:
STEAM_x
:0000000 ; 37
STEAM_x
:0000000 ; 30
STEAM_x
:0000000 ; 30
STEAM_y:y:1111111 ; 28
STEAM_x
:0000000 ; 25
STEAM_x
:0000000 ; 24
STEAM_x
:0000000 ; 23
The queried player has position 4 of 7.
I get that answer by looping through the result set but do anyone know a query which would return the same info.