At the moment I have the following MySQL query:
SELECT
COUNT(*) AS `count`,
`v`.`value`
FROM `client_entity_int` AS `v`
INNER JOIN `client_entity` AS `e`
ON e.id = v.entity_id
WHERE (v.attribute_id = '1') AND (e.deleted = 0)
GROUP BY `v`.`value`
Which returns the following:
+-------+-------+
| count | value |
+-------+-------+
| 9 | 0 |
| 11 | 1 |
+-------+-------+
What I would WANT it to return is the above, INCLUDING a column showing a comma-separated aggregate of all entity_id's found in the above query.
Is this possible in the same query, and if so, how? Example:
+-------+------------------+
| count | value | entities |
+-------+-------+----------|
| 9 | 0 | 1,2,3,4 |
| 11 | 1 | |
+-------+-------+----------|