A simple way of doing this is to create a history entry for the user's score after a match, showing the increase or decrease in their ranking score. After each match the previous entry can be looked at, change the score of it, then create a new entry with that score.
The downside of this is that it won't be dynamic based directly on the data of the scores table, so any fixes post-match would not be reflected across the user scores.
Another method is to calculate the score independent of the SQL query and store the value somewhere, then return it to the user. This could be a virtual column in the database that is calculated based on the game scores. To prevent this calculation taking up too much memory and running every time its called, you can implement caching that is refreshed after each new game that happens.
