Create a self relationship from Players to Players_better, where Players::average > Players_better::Average.
In Players, create a calculated "ranking" field that is a Count ( Players_better ) + 1.
Or via SQL if you don't want an extra TO:
Ranking field Calculation =
COUNT ( * )
Average > ?";
) + 1
Make sure to manually make the calculation unstored, it'll be stored by default.
For sorted found set,
Let ( n = Get ( RecordNumber ) ;
Case ( GetNthRecord ( average ; n - 1 ) = average ; GetNthRecord ( rank ; n - 1 ) ; n )
only for saying...