Hello,
Need your help with the following. Not sure exactly whether this can be done with sqls alone...
Let's say I've data in the table as follows:
Code:
username points
john 6
mary 8
katie 9
joe 2
sean 6
bill 7
When sorted (ordered by points DESC, then username), the results would appear as:
Code:
katie 9
mary 8
bill 7
john 6
sean 6
joe 2
I need a query to select a user and return his username and ranking in the ordered data. For example:
query mary
return mary 2
query sean
return sean 5
Is there a way to get to his ranking?
Currently, I've an sql to do the sorting of the data. I then use a loop with a counter to find out his ranking.
Could I do it with sqls alone?
Thanks in anticipation
