SELECT 
	taggroup_id AS id,
	taggroup_name AS `name`,
	taggroup_color AS color,
	tags.tags_ids AS tag_ids
FROM
cms_taggroups
LEFT JOIN ( SELECT 
	tag_taggroup_id,
	GROUP_CONCAT(tag_id ORDER BY tag_name) AS tags_ids
	FROM cms_tags
	GROUP BY tag_taggroup_id
) tags ON taggroup_id = tag_taggroup_id
WHERE taggroup_id != 0;