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.
Author |
Topic |
niyaz4872
Starting Member
41 Posts |
Posted - 2011-10-08 : 04:39:03
|
following is my table structureid Desc1 a1 b2 c2 d2 efollowing is sample results i wan'tid Desc1 a,b2 c,d,e |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-10-08 : 04:43:25
|
[code]SELECT id,STUFF((SELECT ',' + [Desc] FROM yourtable WHERE id = t.id ORDER BY [Desc] ASC FOR XML PATH('')),1,1,'') AS [Desc]FROM (SELECT DISTINCT id FROM yourtable)t[/code]------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
niyaz4872
Starting Member
41 Posts |
Posted - 2011-10-08 : 05:00:39
|
tnx |
 |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-10-08 : 05:03:35
|
wc------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
|
|