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

hi,
i have a table called names and field name
select * from names
name
a
b
c
d

i want to display like this
name
a,b,c,d
how it is possible


Regards
Baiju

Answer Posted / soorai ganesh

Hi Friend,

If u use SQLSERVER 2005 u can try like this............

CREATE TABLE EMP ( ENAME VARCHAR(25))

INSERT INTO EMP VALUES('Ganesh')
INSERT INTO EMP VALUES('Narendra')
INSERT INTO EMP VALUES('Rinku')
INSERT INTO EMP VALUES('Selvam')
INSERT INTO EMP VALUES('Kirti')

SELECT REPLACE(REPLACE(
( SELECT ENAME AS EmpName FROM EMP FOR XML PATH ('') ) ,'<EmpName>',''),'</EmpName>',',')

Is This Answer Correct ?    6 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is tabulation?

946


What do you understand by a view? What does the with check option clause for a view do?

994


What are the different types of lock modes in sql server 2000?

938


Distinguish between nested subquery and correlated subquery?

1038


We are updating a field in sql and alter the row also.after giving the commit command the system is crashed.what will happen to the commands given,whether it will update and alter the table or not?

1381


What is bcnf normalization form?

1105


How to convert numeric expression data types by assignment operations?

1067


What is a rownum?

968


what are user defined datatypes? : Sql server database administration

962


How to backup encryption key ?

182


What is Fragmentation and Defragmentation? For 32GB Table,How can we do the fragmentation?

4375


Explain the first normal form(1nf)?

1021


When you should use a low fill factor?

990


Can you explain various data region available in ssrs with their use?

969


Characterize join and name diverse sorts of joins?

965