. 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 is the difference between functions, procedures, and packages in pl/sql?
SELECT ROUND(TRUNC(MOD(1600,10),-1),2) FROM dual;
what is difference between "Primary key" and "Unique key"?
What is the most restrictive isolation level? : Transact sql
how many ways to get the current time? : Sql dba
Does mysql support pl sql?
How to create a table using constraints... IF i change the PARENT KEY value ,then CHILD KEY table will also to change in the another table... plz reply ur answers @ mak2786@gmail.com Arunkumar
type type_name is table of varchar2(30) index by binary_integer for the above type you have to create a identifier... like identifier_name type_name; for the above type you can use the below methods..like first , last , prior, next , delege..etc...like this.. if you create a cursor...like cursor cursor_name is select * from scott.emp; is there any methods like above to use prior, fist , last , next , trim ,etc...
i have 2 table table one 4 columns respective values a1 7,a2 6,a3 8 ,a4 12 & table two 4 colums respective values a1 7,a2 6,a3 8,a4 15.if table one & table two 3 colums same then 4th column values 1)Qes diff >5 then print 5 * diff value 2)Que diff <5 print 5
how to get help information from the server? : Sql dba
What is data manipulation language?
Differentiate pl/sql and sql?