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
How optimize sql query with multiple joins in sql server?
What is explicit cursors?
Define Unique Key?
Explain the cursor lock types?
Determine how to use the inserted and deleted pseudo tables?
What is function of master database?
What is store procedure?
What are different type of Collation Sensitivity?
What is entity data services?
What is a result set object returned by odbc_exec()?
Do you know what are the restrictions that views have to follow?
Explain what are sparse columns?
How to get nth highest salary from employee table.
What is db stored procedure?
What happens when unicode strings concatenate with non-unicode strings?