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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the uses of linked server and explain it in detail?

580


What is the difference between PFILE and SPFILE in Oracle?

566


What do you understand by a database object?

574


What is the minimum client footprint required to connect c# to an oracle database?

558


What is BBED in Oracle?

675






How to convert times to characters in oracle?

595


is there a tool to trace queries, like profiler for sql server?

584


What is the maximum number of triggers that can be applied to a single table?

549


How would you edit your CRONTAB to schedule the running of /test/test.sh to run every other day at 2PM?

1429


What do you mean by merge in oracle and how can you merge two tables?

513


How do I know if oracle is installed on windows?

478


What is the exact use of Collections?

1669


What is a system tablespace?

588


What is a data dictionary and how can it be created?

604


What is a named program unit?

571