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 tabulation?
What do you understand by a view? What does the with check option clause for a view do?
What are the different types of lock modes in sql server 2000?
Distinguish between nested subquery and correlated subquery?
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?
What is bcnf normalization form?
How to convert numeric expression data types by assignment operations?
What is a rownum?
what are user defined datatypes? : Sql server database administration
How to backup encryption key ?
What is Fragmentation and Defragmentation? For 32GB Table,How can we do the fragmentation?
Explain the first normal form(1nf)?
When you should use a low fill factor?
Can you explain various data region available in ssrs with their use?
Characterize join and name diverse sorts of joins?