.  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 / phanikumar kode

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

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

table structure: ---------------- col1 col2 ----- ----- 01-mar-2012 11:12:46 01-mar-2012 11:12:10 01-mar-2012 11:12:46 01-mar-2012 11:11:23 Write a query to display the result as shown below: col1 col2 ----- ----- 01-mar-2012 11:12:46 01-mar-2012 11:12:10

3325


What are predefined functions in sql?

528


What is data manipulation language?

694


How does stored procedure reduce network traffic?

538


How do I view a sql database?

553






How do I run a sql query?

528


What is the purpose of primary key?

527


How can one get sql*loader to commit only at the end of the load file? : aql loader

561


Why we use join in sql?

526


Can delete statement be rollbacked?

523


what are set operators in sql? : Sql dba

534


What is sql injection vulnerability?

494


What is trigger types in sql?

529


what is the syntax for using sql_variant_property? : Transact sql

528


What is the best partition size for windows 10?

477