I have a tablle like this:

cust acc
-----------
a 1
b 2
b 3
c 4
c 5
c 6


I Want below o/p:
cust acc
---------------
a 1
b 2|3
c 4|5|6

Please any one can you have any ideas share me.
I have urgent requirement.

Answer Posted / dinesh

select cust, listagg(acc,'|') WITHIN GROUP (ORDER BY ACC )as ACC from cust1 group by cust;




This LISTAGG Function is the concept of 11g release2. and
this is the best answer for this question.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do you bind variables in pl sql?

578


What is using in sql?

561


What is cursor and why it is required?

550


Is drop table faster than truncate?

547


what are the 'mysql' command line options? : Sql dba

554






What is foreign key in sql with example?

509


What is a pragma statement?

717


explain the delete statements in sql

577


Can we insert data into view?

525


How many indexes can be created on a table in sql?

494


is it possible to pass an object or table to a procedure as an argument?

565


How do I run a sql trace?

518


How to select random rows from a table?

518


What is cursor explain with example?

551


what is the difference between delete and truncate statement in sql? : Sql dba

544