April 11th, 2013, 06:41 PM
SQL to get highest rated players over time
So I have a chess website and everyone has a rating. It's stored in a table with the following fields:
What I'd like to get out of this is a SQL statement that would give me
user weeks at top spot
user1 15 weeks
user2 12 weeks
user3 9 weeks
At the moment, I can't think of a statement that would give me this and I'm thinking I may have to resort to using multiple statements. Even with multiple statements, however, I can't think of a way of doin this. Any help you can give would be greatly appreciated.
April 11th, 2013, 07:00 PM
start with a query that gets you the ratings by user by week
aside: if a user has several games in one week, how is the rating for that week calculated?
anyhow, once you have that query working, let's see it and i'll help you from there