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
 General SQL Server Forums
 New to SQL Server Programming
 combine the rows

Author  Topic 

pavansagar
Starting Member

2 Posts

Posted - 2006-11-11 : 05:59:30
hai,
i have the data like this

Id [name] value
------------------------------
1 sam abc
1 sam def
1 sam ghi
2 john abc
2 john def


for a unique Id all the fields are same except the value.Now I want to join them and the data should appear like below.

Id [name] value
------------------------------------
1 sam abc,def,ghi
2 john abc,def

please help me regarding the query.
thanks
from,
pavansagar

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2006-11-11 : 06:13:19
Check this article:

[url]http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=56058[/url]

Harsh Athalye
India.
"Nothing is Impossible"
Go to Top of Page

chiragkhabaria
Master Smack Fu Yak Hacker

1907 Posts

Posted - 2006-11-11 : 07:44:42
Also
http://sqljunkies.com/WebLog/amachanic/archive/2004/11/10/5065.aspx

Chirag

http://chirikworld.blogspot.com/
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-11-12 : 20:02:32
Note that if the concatenated string exceeds 8000 characters, you need to use more than one variable. If you use front end application, do concatenation there

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -