Displaying a single rank in MySQL table

Posted by MichaelInno on Stack Overflow See other posts from Stack Overflow or by MichaelInno
Published on 2010-01-28T21:06:47Z Indexed on 2010/06/15 22:02 UTC
Read the original article Hit count: 317

Filed under:
|
|
|
|

I have a table called 'highscores' that looks like this.

id      udid       name       score
1       1111       Mike       200
2       3333       Joe        300
3       4444       Billy      50
4       0000       Loser      10
5       DDDD       Face       400

Given a specific udid, I want to return the rank of that row by their score value.

i.e. if udid given = 0000, I should return 5.

Any idea how to write this query for a MySQL database?

© Stack Overflow or respective owner

Related posts about sql

Related posts about mysql