. 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 the PL/SQL Statements used in cursor processing ?
Can we call a function containing dml statements in a select query?
need to split a string into separate values. eg. col1 col2 ---------- 100 - 'a,b,c' 200 - 'a,x,d,e' 300 - 'c' result: value count ------------- a - 2 b - 1 c - 2 etc.
What are different types of tables in sql?
What is embedded sql what are its advantages?
how to get @@error and @@rowcount at the same time? : Sql dba
write a query to display diference between two dates in sql server
What is the difference between jpql and sql?
how can we transpose a table using sql (changing rows to column or vice-versa) ? : Sql dba
will function return more than one value how
What is varchar example?
What is your daily office routine?