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

If I have a select statment which retrives 2 rows, & that
rows have the same data in all the fields except the last
field and I want to merge the 2 rows to be in 1 row with
concatenating the last field which have the different
data.... eg: the 1st row has these fields: A-B-C
the second row has: A-B-X ........ i want to merge the two
row to be in one row like ----> A- B- C,X

Answer Posted / murali mohan

Try this...Hope this will give the Required Answer
create table testsamp(a char,b char,c char);
insert into testsamp values ('A','B','C');
insert into testsamp values ('A','B','X');

select a,b,c from(
select a , b,
c||lead(c,1) over (partition by a,b order by a,b) c from
testsamp ) tmp where rownum=1;

Regards,
Murali

Is This Answer Correct ?    4 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between alert log file and tarce file ?

2230


How to see free space of each tablespace?

1082


How to drop an index?

1014


What are the various types of snapshots ?

1082


How to write text literals in oracle?

1118


What is the meaning of recursive hints in oracle?

1098


Can multiple columns be used in group by in oracle?

1037


Explain the use of control file?

1177


Explain the difference between sap and oracle?

1086


What is the difference between hot backup and cold backup in oracle? Tell about their benefits also.

1031


What exactly do quotation marks around the table name do?

1025


What is a cursor variable?

1215


In Oracle Applications We are Using Sub Ledger Accounting. When we Transfer the Data all modules (AP,AR,CE,FA) to SLA We done Some customizations? What are They??

1909


Explain overloading. Can functions be overloaded?

1047


How to write a query with a left outer join in oracle?

1125