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 are the uses of Database Trigger ?

1686


How to use an explicit cursor without open statements?

1041


Explain the use of log option in exp command.

1096


Design database draw er diagram for a certain scenario ?

4561


Explain overloading. Can functions be overloaded?

964


How to write a left outer join with the where clause in oracle?

1067


How can we find out the duplicate values in an oracle table?

1032


What is meant by raw datatype?

1045


How many categories of data types in oracle?

1009


What is merge statement used for?

1005


Where are the settings stored for each instance in oracle?

1094


How to define default values for formal parameters?

1024


What is background process in Oracle?

1083


What language does oracle use?

1083


what are steps for interface? where is exchange rate defined in which table?

2121