oracle listagg性能,sql - 为什么Oracle 12中的LISTAGG不使用我的定界符? - 堆栈内存溢出...

在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>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值