DB2 version ?
Using recursive SQL (this works as long as C is unique within cola,colB)
Code:
with cte (cnt,colA, colB,colC ,outp) as
( select 1, colA, colB, min(colC), cast(char(min(colC)) as varchar(200))
from tab1
where colA = +6990
group by colA,colB
union all
select a.cnt + 1 , a.colA, a.colB, b.colC, a.outp || char(b.colC)
from cte A , tab1 B
where a.colA = b.colA and a.colB = b.colB
and b.colC = (select min(colC) from tab1 C where c.colC > a.colC)
and a.cnt < 100
)
select colA,colB,outp from cte A
where cnt = (select max(cnt) from cte B where a.colA = b.colA and a.colB = b.colB)
Using XMLFunctions
Code:
select colA, colB
, replace(replace(cast(xml2clob(xmlagg(xmlelement(name X ,colC))) as varchar(200) ),'<X>',' ') ,'</X>','')
from tab1
group by colA,colB