Skip to content
Advertisement

SQL comparing column changes the last X hours

I have a table containing log entries that looks like this:

I need help making a query that returns a list of levels gained the last X hours for each character, preferably sorted by amount gained. So by this example my wanted result is this

Advertisement

Answer

Try an aggregate query that compares the MIN and MAX level of each character :

NB : this assumes that the level of a character may only increase. If the level of a character decreases, it will still appear as a gain.

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement