@PViddy The problem can never be solved with a SQL join.
What happens in the API is this: perform the join, then filter.
So first you join a game and get a result like:
game
player
rating
1
A
1900
1
B
1900
1
C
1900
1
D
2100
2
A
1900
2
B
1900
2
C
1900
2
D
1800
3
A
2200
3
B
2100
3
C
2200
3
D
2000
And now you filter rating>=2000 on all records of that table. So the result would be this:
game
player
rating
1
D
2100
3
A
2200
3
B
2100
3
C
2200
3
D
2000
It's easy to find a game where on participant matches a criterium.
But there is no row-based filter in SQL that could require all players to be >=2k.
For that you need either SQL subselects (which is not supported by our API logic for technical reasons) or we calculate somehting like min/max/mean rating during fetching the game in the API.
The latter is generally possible, but not so simple with our API logic, because a game participant has potentially multiple leaderboards, so it need to return these KPIs per leaderboard (even though in practice each game right now has only one leaderboard).