I have an mysql table with jobs. This table contains an entry 'insertionDate' which contains the date that a job was insertion.
Now I want to know the amount of jobs that were
- inserted today
- inserted this week
- inserted this month.
How can I do this with only 1 query?
Now I use 3 queries for this. The query for the jobs from last week is:
COUNT( * )
DATEDIFF( NOW(), insertionDate ) < 7