Загрузка данных
from ( select * from cte_gr where cid = 1 union all select * from cte where cid = 5 ) totals