I have a table called purchases, with columns: name, amount, city, date. I want to return the sum of amount and order it by city with most sum of amount, and compare two date ranges. Here is a fiddle: http://sqlfiddle.com/#!9/6b2017/6 I can get the first set of cities with their sum(amount) […]