B
B
BonBon Slick2020-06-02 20:35:50
SQL
BonBon Slick, 2020-06-02 20:35:50

Calculate what place the player takes in the leaderboard?

To display in the player's profile, you need to display his position, conditional 4000th place, or 1st, etc.
If I understand correctly orderBy -> score and add count to the number of users whose score is higher than the current user.
The question is how to generate a request and count the players who have more points?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
Lazy @BojackHorseman, 2020-06-02
@BonBonSlick

SELECT COUNT(*) + 1 FROM <tablename> WHERE `score` > ?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question