.  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



.  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..

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

.  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..

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

.  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..

Answer / ramaraju

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

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More SQL PLSQL Interview Questions

What is the difference between functions, procedures, and packages in pl/sql?

0 Answers  


SELECT ROUND(TRUNC(MOD(1600,10),-1),2) FROM dual;

10 Answers  


what is difference between "Primary key" and "Unique key"?

4 Answers   PreVator,


What is the most restrictive isolation level? : Transact sql

0 Answers  


how many ways to get the current time? : Sql dba

0 Answers  






Does mysql support pl sql?

0 Answers  


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

3 Answers  


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...

1 Answers   Satyam,


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

1 Answers  


how to get help information from the server? : Sql dba

0 Answers  


What is data manipulation language?

0 Answers  


Differentiate pl/sql and sql?

0 Answers  


Categories