Since this is complicated I'll give an example of what I'm trying to attempt:
In the first table, User Data, I have user's and their saved game files (savefile's). Each user can be associated with multiple saved game files. The second table is Scores of all the saved game files on the server. It has a row for each savefile, and also a timestamp of when the game was saved, the score at that point, and the title of the game.
Now say I want to reset to a zero score all users' most recent files for each game title. This means I need to UPDATE Scores SET score=0 WHERE user=x AND title=y AND timestamp = (SELECT max(timestamp) FROM Scores where user=x and title=y);
.
However, I'm unsure of how to do this with user not being directly in the Scores table. Since the User Data and Scores tables are joined by a unique savefile, though, I know there should be a way to do this. Also, if anybody could recommend to me the best way to handle this iteration so that the statement executes for ALL user, title pairs, that would be helpful!
Logistics - using SQL and Python via mysqldb.
Thanks!