.  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.
CUST         ACC
a            dv
b            fg
b            bh
c            mk
c            cl
c            so
result:-
A  B   c
dv fg mk
   bh cl
      so

Answer Posted / ramaraju

select cust,listagg(acc,'|') within group(order by acc) from t2 group by cust;

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is pl sql better than sql?

548


how many groups of data types? : Sql dba

563


When should I use nosql database?

549


Can a key be both primary and foreign?

507


Why is sharding used?

549






When is a declare statement required?

671


Define commit?

546


How to write pl sql program in mysql command prompt?

510


What is a database trigger?

607


what is the difference between mysql_fetch_array and mysql_fetch_object? : Sql dba

555


What is primary key secondary key alternate key candidate key?

540


Explain what is a database?

645


how can we optimize or increase the speed of a mysql select query? : Sql dba

503


Can we use commit inside a trigger?

518


What are the constraints available in sql?

575