I am using MySQL and I have the following table:
| clicks | int |
| period | date |
I want to be able to generate reports like this, where periods are executed over the last 4 weeks:
| period | clicks |
| 1/7 - 7/5 | 1000 |
| 25/6 - 31/7 | .... |
| 18/6 - 24/6 | .... |
| 12/6 - 18/6 | .... |
or in the last 3 months:
| period | clicks |
| July | .... |
| June | .... |
| April | .... |
Any ideas on how to create select queries that can generate an equivalent date range and number of clicks?
source
share