select coalesce(t1.col1, t2.col2) as "группировка"
, coalesce(t1.c, 0) as "кол-во_1"
, coalesce(t2.c, 0) as "кол-во_2"
from (select col1, count(*) c from test group by col1) t1
full join
(select col2, count(*) c from test group by col2) t2 on t1.col1 = t2.col2
order by 1
;