select p.player_id, p.nick, pe.game_type_cd, pe.elo, rank()
over (partition by pe.game_type_cd order by pe.elo desc)
from players p, player_elos pe
- where p.player_id = pe.player_id;
+ where p.player_id = pe.player_id
+ and p.active_ind = True
+ and pe.active_ind = True
+ and pe.games >= 32;
end;