Selecting top 10 per week

I have a table that records clients and purchases by week. The column names are as follows:

week | id_client | total_purchases

I want to run a query in SQLite that provides a list of the top 3 clients sorted descending by volume of purchases.

If I use limit 3 at the end it doesn't work because I want the top 3 by each week.

Read more here:

Content Attribution

This content was originally published by MariaGG at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: