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
WHAT IS THE DEFINITION OF DEFAULT CUSTOMER IN AR?
what is the use of system.effective.date variable in oracle?
What are the benefits of ordbms?
What are the restrictions on external table columns?
How to drop an index in oracle?
How to insert a new row into a table in oracle?
What are the uses of linked server and explain it in detail?
What is the cache hit ratio, what impact does it have on performance of an Oracle database and what is involved in tuning it?
What are ddl statements in oracle?
How to create a table index in oracle?
How can I introduce multiple conditions in like operator?
Explain what are the different type of segments?
What are the execution control statements?
How to export data with a field delimiter?
How to start a specific oracle instance?