Let's say I have two SQLite tables:
Table Players id|name Table Scores id|player_id|score|timestamp
What would an SQLite query looks like, if I want to calculate the average scores for every players, but only from 5 of their latest scores. I've a working query that only works to calculate the average from all scores (using GROUP BY score and AVG(score)).
Basically I need to do a SELECT statement that first returns last 5 scores for all players, and then GROUP the results by player and average the scores, but not sure how to begin. Thanks.