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 |
|
Pace
Constraint Violating Yak Guru
264 Posts |
Posted - 2008-10-21 : 11:22:13
|
Hi All, Ive seen this before, I just cant remember how to do it, can someone help? ID TYPE TEXT1 1 A2 1 B 3 2 C4 2 DID TYPE TEXT1 1 A,B2 2 C,D"Impossible is Nothing"  |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-10-21 : 11:24:49
|
| [code]SELECT t.TYPE,LEFT(tl.txtlist,LEN(tl.txtlist)-1)FROM(SELECT DISTINCT TYPE FROM Table)tCROSS APPLY (SELECT TEXT + ',' FROM Table WHERE TYPE=t.TYPE FOR XML PATH(''))tl(txtlist)[/code] |
 |
|
|
Pace
Constraint Violating Yak Guru
264 Posts |
Posted - 2008-10-21 : 11:31:36
|
Thank you so much "Impossible is Nothing" |
 |
|
|
|
|
|