. 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 forced views
Why functions are used in sql?
Does pl/sql support create command?
Are stored procedures compiled?
What is mutating table?
i need department wise top 2 employees salary.which logic i will use
What is procedure and function?
how to create temparary sequence
Why do we use sql constraints? Which constraints we can use while creating database in sql?
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.
Which are the most commonly used sql joins?
Which join condition can be specified using on clause?
Oracle (3259)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)