Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 SQL query

Author  Topic 

ravilobo
Master Smack Fu Yak Hacker

1184 Posts

Posted - 2004-10-26 : 09:22:50
I have a table like following

col1 col2 col3
--------------
c1 1 a
c1 1 g
c1 1 c
c2 2 d
c2 2 j

i need the output as

col1 col2 col3
--------------
c1 1 a,g,c
c2 2 d,j

I don't want to use cursors...
Thank you.


------------------------
I think, therefore I am

nr
SQLTeam MVY

12543 Posts

Posted - 2004-10-26 : 09:43:37
see
http://www.nigelrivett.net/CSVStringFromTableEntries.html
String for each id value in a table


==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

ravilobo
Master Smack Fu Yak Hacker

1184 Posts

Posted - 2004-10-26 : 10:45:51
Great!!!

Thanks that worked.

------------------------
I think, therefore I am
Go to Top of Page
   

- Advertisement -