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

please explain.. DB architecture ...

1568


What are nested tables?

678


Calculate difference between 2 date / times in oracle sql?

577


What is the relationship among database, tablespace and data file?

548


Can a formula column referred to columns in higher group ?

2091






Explain the features of oracle?

604


What is data file?

621


What is the simplest tool to run commands on oracle servers?

522


What is the difference between the Oracle ODBC driver and a Microsoft ODBC (Open Database Connectivity) Driver?

622


What are dml statements in oracle?

623


Can we use oracle pl/sql block in core java? if so how? pls get back to me .....

2514


How to do clean up if create database failed?

578


What are the different editions of oracle?

598


What is data block in Oracle?

621


State some uses of redo log files?

570