I\'m trying to figure out a way to return results by using the group by function.
GROUP BY is working as expected, but my question is: Is it possible to have group b
SELECT table1.*, GROUP_CONCAT(id SEPARATOR ',') AS children_ids FROM table1 WHERE (enabled = 1) GROUP BY ancestor , CASE WHEN ancestor IS NULL THEN table1.id ELSE 0 END