Answer the question
In order to leave comments, you need to log in
How to find out the record number in sql query when sorting by some parameter?
There is a user table users in which there is a score field - experience points. You need to sort by this parameter (score) and find where in this sorting the user with some specific id is located (there is an id field in the table). That is, as a result of the request, we should get one number. How to do it?
Answer the question
In order to leave comments, you need to log in
Where is the user in the rating?
On how many people are in front of him.
select count where score < (select score where id = :curuser)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question