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
Explain what are the restrictions that views have to follow? : SQL Server Architecture
How to access the deleted record of an event?
What is bcp? When does it use?
What is an identity column in insert statements?
How to connect of datebase with sql express.?
What stored by the tempdb ? : sql server database administration
What are the different types of subquery?
What is difference between temp table and cte?
Why do we use stored procedures in sql server?
Can you explain different types of locks in sql server?
What is policy management?
What is a covering index?
How to use linked server?
what method you can use to reduce the overhead of Reporting Services data sources?
Does sql server use t sql?