I have a table in mySql which has the users ID and scores.
What I would like to do is organise the table by scores (simple) but then find where a certain user ID sits in the table.
So far I would have:
SELECT * FROM table_score
ORDER BY Score DESC
How would I find where userID = '1234' is (i.e entry 10 of 12)
The following query will give you a new column
UserRank, which specify the user rank:SQL Fiddle Demo
This will give you something like:
Then you can put this query inside a subquery and filter with a
userIdto get that user rank. Something like:SQL Fiddle Demo