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
Can we use oracle pl/sql block in core java? if so how? pls get back to me .....
Is insert autocommit in oracle?
How to assign query results to variables?
how to join query for one source type is oracle another source type is sql server ?
Explain the use of rows option in exp command.
What is open database communication (odbc) in oracle?
How to insert a new row into a table in oracle?
What is ADDM Advisor in Oracle?
What is the scope of a local variable?
Can the query output be sorted by multiple columns in oracle?
How can I get column names from a table in oracle?
How to define a variable of a specific record type?
Explain about integrity constraint?
For a field in a repeating frame, can the source come from the column which does not exist in the data group which forms the base for the frame ?
Please explain oracle left join with an example?