在12c上为我工作正常:
SQL> select banner from v$version;
BANNER
--------------------------------------------------------------------------------
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
PL/SQL Release 12.1.0.2.0 - Production
CORE 12.1.0.2.0 Production
TNS for Linux: Version 12.1.0.2.0 - Production
NLSRTL Version 12.1.0.2.0 - Production
SQL> create table my_shared_table(x varchar2(10), y varchar2(10), value number);
Table created.
SQL>
SQL> insert into my_shared_table
2 select 'x', 'y', 1 from dual union
3 select 'x', 'y', 2 from dual union
4 select 'x', 'y', 3 from dual union
5 select 'x', 'y', 4 from dual union
6 --
7 select 'x1', 'y1', 5 from dual union
8 select 'x1', 'y1', 6 from dual union
9 select 'x1', 'y1', 7 from dual union
10 select 'x1', 'y1', 8 from dual;
8 rows created.
SQL>
SQL> select x, y, listagg(value, '; ') within group (order by value) as z
2 from my_shared_table
3 group by x, y;
X Y Z
---------- ---------- --------------------
x y 1; 2; 3; 4
x1 y1 5; 6; 7; 8
SQL>