Bindle founders received an email from the VC firm asking to share their cumulative revenues per country. The first instinct was to open Excel or Google Spreadsheets and go “old school”. But that’s an old habit. Let’s find out how to work with cumulative aggregates in SQL
Aggregated values are not a new concept for us. They are the result of applying grouping and counting or grouping and summing techniques. Here’s a query that gives us revenue per country per month:
SELECT country, DATE_TRUNC('month', p.created_at), SUM(amount) FROM purchases...