I have stuck in small query. There is a table named Table_Activities.
Table_Activities (Act_id, Date, Activity_name, description).
We need to generate a report out of this. User will choose the month and year for which he wants to generate the report from drop down list.
We need to display All the activities for that month and year group by Activity name.
Example – User Chooses June and 2012.
Report will be-
Gardening
01/06/2012 - They have planted 100 trees.
14/06/2012 - something
27/06/2012 - something
Training
02/06/2012 - Detail description
15/06/2012 - something
28/06/2012 - something
My question is what will be the mysql query to fetch data in this format??
To return an exact format as indicated in your question, please try below:
SQL FIDDLE HERE.
Output as below: