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 |
|
aoriju
Posting Yak Master
156 Posts |
Posted - 2009-03-09 : 07:11:48
|
| Hello,I have a Table Table Variable Holding The ValuesTestTest1Test2 like that on each Columni want to retrieve that values into Test,Test1,Test2 Like that (WithOut Using Any Loops) |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
|
|
Nageswar9
Aged Yak Warrior
600 Posts |
Posted - 2009-03-09 : 07:51:49
|
| declare @temp table ( id int,val varchar(32))insert into @temp select 1 ,'test1' union allselect 1,'test2' union allselect 1,'test3' union allselect 2 ,'test4' union allselect 2,'test5'select distinct id,stuff(( select ','+ val from @temp where t.id = id for xml path('')),1,1,'') as val from @temp t |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2009-03-09 : 10:43:36
|
Which is the solution provided in the link above. E 12°55'05.63"N 56°04'39.26" |
 |
|
|
|
|
|
|
|