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)
 Concatenate grouped row fields

Author  Topic 

SoftFox
Starting Member

42 Posts

Posted - 2007-11-08 : 07:41:38
If i have a table like the following:

ID SomeText
---------------
1 monkey
1 fish
2 badger
2 beaver
2 rat

and i want to display it as the following:

ID AllTextValues
------------------------
1 monkey fish
2 badger beaver rat

Is there a way of doing this without resorting to a cursor?

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2007-11-08 : 07:48:20
http://sqlblog.com/blogs/adam_machanic/archive/2006/07/12/rowset-string-concatenation-which-method-is-best.aspx


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page
   

- Advertisement -