Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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.

Answers were Sorted based on User's Feedback



have table with two columns with datatypes as number and varchar and the values in A column like ..

Answer / kavitha neditunta

select WM_CONCAT(a||','||b)
from tablename;

Is This Answer Correct ?    10 Yes 1 No

have table with two columns with datatypes as number and varchar and the values in A column like ..

Answer / prativa mishra

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

Is This Answer Correct ?    5 Yes 0 No

have table with two columns with datatypes as number and varchar and the values in A column like ..

Answer / krishna

select rtrim(xmlagg(xmlelement(E,
EMPID||','||NAME||','||'')).extract('//text()') ,',')
empid from emp1

Is This Answer Correct ?    7 Yes 3 No

have table with two columns with datatypes as number and varchar and the values in A column like ..

Answer / sunaksha

select listagg( A||','||B || ',') within group (order by A) from table_name;

Is This Answer Correct ?    4 Yes 0 No

have table with two columns with datatypes as number and varchar and the values in A column like ..

Answer / saravanan

Try this way!

create table stest(num int,name varchar(10),value numeric
(10,2));

insert into stest values(101,'SARAN',1000.58);
insert into stest values(102,'KALA',1200.18);
insert into stest values(103,'AYYA',3000.40);
insert into stest values(104,'RATNA',4000.57);

SELECT * FROM STEST;

declare @str varchar(2000);
set @str = null;
select @str=ISNULL(@str+',','')+ltrim(STR(num))+','+name
from stest
select @str;

Is This Answer Correct ?    3 Yes 2 No

have table with two columns with datatypes as number and varchar and the values in A column like ..

Answer / prativa mishra

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

Is This Answer Correct ?    1 Yes 0 No

have table with two columns with datatypes as number and varchar and the values in A column like ..

Answer / sona mathew

select listagg(c1||','||c2,',')
within group (order by c1||','||c2)
from tab;

Is This Answer Correct ?    1 Yes 0 No

have table with two columns with datatypes as number and varchar and the values in A column like ..

Answer / vi.s.senthilkumar

select column1||','||column2 result from tableName;

Is This Answer Correct ?    2 Yes 3 No

Post New Answer

More SQL PLSQL Interview Questions

What is difference between stored procedures and application procedures?

0 Answers  


Maximum how many triggers can we use in trigger and How to find out how many records it fetched.

1 Answers   TCS,


What is scalar and vector?

0 Answers  


Which data dictionary views have the information on the triggers that are available in the database?

0 Answers  


What is the largest value that can be stored in a byte data field?

0 Answers  


how many sql ddl commands are supported by 'mysql'? : Sql dba

0 Answers  


What are all the difference between Like and Contains ?

2 Answers   LG Soft,


Can you call pl/sql package functions from within a fast formula?

0 Answers  


what are the different tables present in mysql? : Sql dba

0 Answers  


What are the types of triggers in sql?

0 Answers  


Can we join more than 2 tables in sql?

0 Answers  


Do we need to create index on primary key?

0 Answers  


Categories