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
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / sreeharibabu g
select max(a),max(b),listagg(c,',') within group ( order by null) from testsamp group by a,b;
Is This Answer Correct ? | 0 Yes | 0 No |
what is the syntax of UPDATE command?
What exactly do quotation marks around the table name do?
What is a package ? What are the advantages of package ?
Differentiate between translate and replace?
How can we find out the duplicate values in an oracle table?
how to select alphabets in a one column , for this the table name is PA_TASKS and column name is TASK_NUMBER, In TASK_NUMBER the data like this 1.1.3NN,1.1.4NN,1.5.1NN,1.3.2NE,1.5NN,1NN,1.2NE,1CE , For this i need to disply output as only NN,but not other alphabets, if NN is thre means i should display , otherwise leave that blank or empty Its some urgent requirement ,thanks in advance
What are the types of partitions in oracle?
how to retrieve 1st and last row of table without using group functions??
What is a synonym? What are its various types?
what is shell?
How to grant create session privilege to a user in oracle?
What is SQL access advisor in Oracle?