What are you trying to do? Maybe it can be written a different way
Edit: Try this, you will need to add the few other conditions that you have.
PHP Code:
SELECT
( SELECT COUNT(*) + 1
FROM tblData
WHERE ((Kills/Deaths) > (t.Kills/t.Deaths) OR ((Kills/Deaths) = (t.Kills/t.Deaths) AND id<t.id))
) as rowIndex,
t.Kills/Deaths,
AuthID
FROM tblData t
ORDER BY rowIndex ASC;
Source [ID, kills, deatrhs, authID]
Code:
"1" "20" "9" "STEAM_1"
"2" "50" "12" "STEAM_2"
"3" "90" "33" "STEAM_3"
"4" "52" "9" "STEAM_4"
"5" "31" "55" "STEAM_5"
Result [Rank, Kills/Deaths, AuthID]
Code:
"1" "5" "STEAM_4"
"2" "4" "STEAM_2"
"3" "2" "STEAM_1"
"4" "2" "STEAM_3"
"5" "0" "STEAM_5"
__________________