I have a table like this:
id employee_id contract_id month year d1 d2 d3
1 25 1 11 2011 1 01 01
2 16 5 11 2011 1 11 0
3 29 3 11 2011 1 001 100
1 25 4 11 2011 0 11 011
Suppose I need data for month='11' AND year='2011', then for all rows having the same 'employee_id', the data should merge like this:
id employee_id contract_id month year d1 d2 d3
1 25 1,4 11 2011 1,0 01,11 01,011
2 16 5 11 2011 1 11 0
3 29 3 11 2011 1 001 100
I was trying GROUP_CONCAT but couldn't figure out the query. Please help.