Calculating Position(Rank)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Calculating Position(Rank)

McTuble
This post has NOT been accepted by the mailing list yet.
Hello I guess I have 2 questions. First I have been given access to information that contains results from an online game. I have made the program that saves the information into an sqlite database for easier manipulation and retrieving. So I have a Users, Rounds and Results table. So the results table will just contain 3 columns roundId, userId and score. roundId to reference the round the score is for, userId to get the username or anything else about the user I may need and then a score column which just contains an integer representing the amount of milliseconds for that round. So my question is... with a query I want to input the userId and roundId and get the position that that user finished. So in my head all I believe I need to do is count the number of rows where their score < userIds score. I'm having a hard time converting that to an sqlite query. Any help would be greatly appreciated. Thank you. So that's my main question... My second question is that there will be over 100k rows for each roundId and about 450 different roundIds. I don't really see any other way to currently store the data. Any of you recommend a better way or is this way at least acceptable?