I have a table that has info like this:
id | staff_id | start_date
1 | 14 | 2015-04-02 00:00:00
2 | 16 | 2015-04-15 00:00:00
3 | 14 | 2015-05-31 00:00:00
4 | 12 | 2015-05-04 00:00:00
What I am trying to do is select and count all entries made by each staff member and group them by month and year so it would display like this:
Staff Member | 12 | 14 | 16
2015-04 | 0 | 1 | 1
2015-05 | 1 | 1 | 0
Can anyone please help me to figure out how to generate this? I just cant figure out how to create a new column for each staff member and also a row for each month/year.