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

Published by

Laurent Schneider

Oracle Certified Master

9 thoughts on “stragg in 11gR2”

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

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

    Don’t forget the NTH_VALUE function as well :)

  3. 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.

  4. 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.


*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>