How?
select civilantid,max(sys_connect_by_path(combinedoc, ' ')) documentno
from ( select civilantid,civdoc, documentno, (documenttype ', ' documentno) combinedoc,
row_number() over(partition by civilantid order by civdoc) rn
from gbl_civdoc_dtl where civilantid = 17)
start with rn = 1
connect by prior rn = rn-1 and prior civilantid = civilantid
group by civilantid
order by civilantid
To manipulate the given data, I did use the Split function in PHP...emm that was like 2 years ago..:)