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
What is the difference between osql and query analyzer?
What are wait types?
Why does sql studio use a single registered database repository? : sql server management studio
What is normalization? Explain different forms of normalization?
What is filestream?
What is a rownum?
How to configure odbc dsn with different port numbers?
How important do you consider cursors or while loops for a transactional database?
What are synonyms?
What is subquery explain with example?
What is etl - extraction, transformation, and loading?
what are the reporting service components in SSRS?
How will you optimize a stored procedure optimization?
Define clusters?
What is a with(nolock)?