Lets say I have a table with the following columns:
- Qty, INTEGER
- SaleDate, DATETIME
I would now like to see this result:
Sold in the last 7 days | Sold in last 14 days
-----------------------------------------------------
10 | 20
I can use a where clause to use between, however how would I get the qty sold for 7 and 14 days?
Filter in the WHERE clause to get days 0 to -14. Then aggregate on days 0 to -7 separately.