SELECT *,
( SELECT GROUP_CONCAT(node_id) FROM cms_nodes
	WHERE node_parent_node_id = sub.node_id
	AND node_type = :node_type
	GROUP BY node_parent_node_id
) AS children_ids
FROM (
	SELECT * FROM cms_nodes
	LEFT JOIN cms_settings ON setting_node_id = node_id AND setting_is_primary
	WHERE
		node_parent_node_id = :node_parent_node_id
		AND node_type = :node_type
	ORDER BY :node_ordering
) sub
ORDER by node_ordering
