. 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
Answers were Sorted based on User's Feedback
Answer / phanikumar kode
select cust,listagg(acc,' ') within group(order by acc) from tbl group by cust;
Is This Answer Correct ? | 2 Yes | 0 No |
Answer / barun
select decode(cust,'a',acc) as A ,decode(cust,'b',acc) as B,decode(cust,'c',acc) AS C from customer
Is This Answer Correct ? | 1 Yes | 0 No |
Answer / ramaraju
select cust,listagg(acc,'|') within group(order by acc) from t2 group by cust;
Is This Answer Correct ? | 0 Yes | 0 No |
What are triggers in sql?
What is trigger explain it?
How delete all records from table in sql?
Is it mandatory for the primary key to be given a value when a new record is inserted?
What is CYCLE/NO CYCLE in a Sequence?
What are different types of sql commands?
What is trigger and types?
Is sql dba a good career? : SQL DBA
what is a cursor
Is natural join same as inner join?
What are % TYPE and % ROWTYPE ? What are the advantages of using these over datatypes?
Which one is faster ienumerable or iqueryable?