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)
 String Concat in Group

Author  Topic 

NickRice
Starting Member

13 Posts

Posted - 2003-11-21 : 12:14:31
I have two tables, say table A & B:

A.ID A.Name
------------------
1 AAA
2 BBB
3 CCC

B.RowID B.FID B.Value
---------------------------
1 1 111
2 1 222
3 2 333
4 3 444
5 3 555
6 3 666

Now, how can I get a resultset as:

Name Value
----------------
AAA 111,222
BBB 333
CCC 444,555,666


Thanks for your help.

Page47
Master Smack Fu Yak Hacker

2878 Posts

Posted - 2003-11-21 : 13:42:51
Check out Converting Multiple Rows into a CSV String (Set Based Method)

Jay White
{0}
Go to Top of Page
   

- Advertisement -