あなたはこのようなことをすることができます
SQL> ed
Wrote file afiedt.buf
1 with x as (
2 select 'row1' db_key, 'value1' db_value from dual union all
3 select 'row2;1', 'value2' from dual union all
4 select 'row2;2', 'value3' from dual union all
5 select 'row3', 'value4' from dual union all
6 select 'row4;1', 'value5' from dual union all
7 select 'row4;2', 'value6' from dual union all
8 select 'row4;3', 'value7' from dual
9 )
10 select key,
11 max( sys_connect_by_path(db_value, ' '))
12 keep( dense_rank last order by curr ) db_value
13 from (select key,
14 db_value,
15 row_number() over (partition by key
16 order by db_value) curr,
17 row_number() over (partition by key
18 order by db_value) - 1 prev
19 from (select substr( db_key,
20 1,
21 (case when instr( db_key, ';' ) = 0
22 then length(db_key)
23 else instr( db_key, ';' ) - 1
24 end)) key,
25 db_value
26 from x))
27 group by key
28 connect by prev = PRIOR curr and key = prior key
29* start with curr = 1
SQL> /
KEY DB_VALUE
------------------------ ------------------------------
row1 value1
row2 value2 value3
row3 value4
row4 value5 value6 value7
Oracleのさまざまな文字列集約手法をリストしたTimHallのページもご覧ください。Oracle 11.2を使用している場合、または関数や型を作成できる場合は、同じ出力を生成するより単純なクエリを生成できるはずです。