分类: Oracle
2016-03-02 11:23:20
--测试环境11gR2
--ZT_USR_IDCARD 1141行
--wmsys.wm_concat
SELECT wmsys.wm_concat(t.status) FROM (SELECT status FROM ZT_USR_IDCARD order by status) t;
Elapsed: 00:00:00.02
Execution Plan
----------------------------------------------------------
Plan hash value: 1481251159
--------------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
--------------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 1 | 12 | 8 (13)| 00:00:01 |
| 1 | SORT AGGREGATE | | 1 | 12 | | |
| 2 | VIEW | | 1054 | 12648 | 8 (13)| 00:00:01 |
| 3 | SORT ORDER BY | | 1054 | 2108 | 8 (13)| 00:00:01 |
| 4 | TABLE ACCESS FULL| ZT_USR_IDCARD | 1054 | 2108 | 7 (0)| 00:00:01 |
--------------------------------------------------------------------------------------
Statistics
----------------------------------------------------------
0 recursive calls
12 db block gets
24 consistent gets
0 physical reads
0 redo size
1247 bytes sent via SQL*Net to client
949 bytes received via SQL*Net from client
5 SQL*Net roundtrips to/from client
1 sorts (memory)
0 sorts (disk)
1 rows processed
--listagg
SELECT listagg(status||',') within group (order by status) FROM ZT_USR_IDCARD;
Elapsed: 00:00:00.01
Execution Plan
----------------------------------------------------------
Plan hash value: 2916943040
------------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
------------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 1 | 2 | 7 (0)| 00:00:01 |
| 1 | SORT GROUP BY | | 1 | 2 | | |
| 2 | TABLE ACCESS FULL| ZT_USR_IDCARD | 1054 | 2108 | 7 (0)| 00:00:01 |
------------------------------------------------------------------------------------
Statistics
----------------------------------------------------------
0 recursive calls
0 db block gets
22 consistent gets
0 physical reads
0 redo size
2854 bytes sent via SQL*Net to client
524 bytes received via SQL*Net from client
2 SQL*Net roundtrips to/from client
1 sorts (memory)
0 sorts (disk)
1 rows processed