I have a table with two columns, id and modifiedDate. I want to query this table to list each id's activity between a time range. My table looks like:
+-----+------------+
| ID | Date |
+-----+------------+
| 1 | 2017.01.19 |
| 1 | 2017.01.18 |
| 1 | 2017.01.10 |
| 1 | 2017.01.09 |
| 2 | 2017.01.19 |
| 2 | 2017.01.18 |
| 2 | 2017.01.10 |
| 2 | 2017.01.09 |
+-----+------------+
Desired output:
+-----+-----------------+------------+-------+
| ID | this week | last week | total |
+-----+-----------------+------------+-------+
| 1 | 2 | 2 | 4 |
| 2 | 2 | 2 | 4 |
+-----+-----------------+------------+-------+