My table has two fields (ID and Status)
I'd like to get a group_concat of the count of each status for each ID.
ID Status
1 True
1 True
1 False
2 True
2 False
2 False
I'd like my results to be
ID Group_Concat
1 (True-2, False-1)
2 (True-1, False-2)
I can parse the True-# / False-# in PHP...unless there's a way to make that a separate field in the group_concat?
I've played with the following, but to no avail..it keeps making a separate row for each ID and Status. This will be part of a larger SELECT but I don't think it's relevant to clutter this question up with that SQL.
SELECT ID,Status, GROUP_CONCAT(c)
FROM (
SELECT ID, Status,COUNT(Status) c
FROM buyer_advert GROUP BY ID,Status
) a GROUP BY ID, Status