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
 SQL Server Development (2000)
 sql

Author  Topic 

shamala
Starting Member

1 Post

Posted - 2004-06-23 : 08:36:02
hi,


How to combine 2 or more rows of data into single row?
If all the rows have same id.

example:--

id name
1 sam
1 nile
1 john

solution should be in the form :

id name
1 sam + nile + john

Can any one solve my problem plz.
thanks in advance

drymchaser
Aged Yak Warrior

552 Posts

Posted - 2004-06-23 : 08:45:48
Here is a link to a method for this.

http://www.sqlteam.com/item.asp?ItemID=11021

Look towards the bottom for the set-based method. This results in a CSV string, but you could adapt it to use a ' + ' delimiter.
Go to Top of Page
   

- Advertisement -