---------------------
| id | is_positive |
---------------------
| 1 | 0 |
| 2 | 1 |
| 3 | 1 |
| 4 | 0 |
| 5 | 0 |
---------------------
SELECT COUNT(id) AS COUNT, GROUP_CONCAT(id) as ids, is_positive
FROM test
GROUP BY is_positive