have table with two columns with datatypes as number and
varchar and the values in
A column like 1,2,3 AND B column values like a,b,c.
now need to display data in a single column as 1,a,2,b,3,c.

Answer Posted / prativa mishra

select rtrim(xmlagg(xmlelement("c",A||' ,'||B||',')).extract('//text()'),',') single_column
from table_name

Is This Answer Correct ?    5 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is sql in mysql? : Sql dba

817


Can we create clustered index without primary key?

710


What is dialect in sql?

703


how to show all tables with 'mysql'? : Sql dba

816


State few characteristics of pl/sql?

723






Inline the values in PL/SQL, what does it mean.?

853


What is a left join?

693


What are local and global variables and their differences?

810


Which constraints we can use while creating database in sql?

790


Which kind of parameters cannot have a default value in pl sql?

805


Is sql dba a good career? : SQL DBA

712


How to get unique records from a table?

682


what is try_catch block in procedure

1393


Explain mutating table error.

840


How do you write a subquery?

694