SELECT COUNT(*) + 1 AS `position` FROM `season_" + season + "` WHERE `RATING` > ( SELECT `RATING` FROM `season_" + season + "` WHERE `ID`= '" + id + "' LIMIT 1 )
select case when a.position = 0
then 0
else a.position +1
end position
from (SELECT COUNT(*) AS `position`
FROM `season_" + season + "`
WHERE `RATING` > ( SELECT `RATING`
FROM `season_" + season + "`
WHERE `ID`= '" + id + "' LIMIT 1 )
) as a