Categories
11gR2 sql

stragg in 11gR2

This will be a killer in the Oracle forums 😉
LISTAGG (measure_expr [, 'delimiter_expr'])
WITHIN GROUP (order_by_clause) [OVER query_partition_clause]

for instance
SELECT LISTAGG(ename,',') WITHIN GROUP (ORDER BY ename) FROM emp;
ADAMS,ALLEN,BLAKE,CLARK,FORD,JAMES,JONES,KING,MARTIN,MILLER,SCOTT,SMITH,TURNER,WARD

By Laurent Schneider

Oracle Certified Master

9 replies on “stragg in 11gR2”

So it won’t be wm_concat, but I’m fine with it as long as LISTAGG is documented and performs fast !

I was very happy when I saw this in the New Features Guide this morning!

Don’t forget the NTH_VALUE function as well 🙂

I was very happy to see the new analytical features, can’t wait to give them a whirl.

Be interesting to compare the performance of this stragg feature against the others too.

The collect function has also 2 extra possibilities in 11gr1 and 11gr2. You can sort and you can do a distinct. You can use this to build some kind of variant on listagg.

Somehow these 2 new possibilities aren’t mentioned in the new feautures docs.

Leave a Reply

Your email address will not be published.