Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


.  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 are the forced views

6 Answers   Hexaware, TCS,


Why functions are used in sql?

0 Answers  


Does pl/sql support create command?

0 Answers  


Are stored procedures compiled?

0 Answers  


What is mutating table?

11 Answers   Saama Tech,


i need department wise top 2 employees salary.which logic i will use

17 Answers  


What is procedure and function?

0 Answers  


how to create temparary sequence

2 Answers   TCS,


Why do we use sql constraints? Which constraints we can use while creating database in sql?

0 Answers  


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.

7 Answers   MTS,


Which are the most commonly used sql joins?

1 Answers  


Which join condition can be specified using on clause?

0 Answers  


Categories