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 |
|
aravindt77
Posting Yak Master
120 Posts |
Posted - 2007-12-12 : 05:48:21
|
| Hi,Table Name -- TestCol1 Col2----------1 ABC2 DEF3 GHIResult must be --------------ABC,DEF,GHICan anybody help me ??RegardsAravind |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
|
|
ranganath
Posting Yak Master
209 Posts |
Posted - 2007-12-12 : 08:50:21
|
| Hi,Try ThisDeclare @T Table(id int, col1 varchar(10))Insert into @T Select 1, 'A' union allSelect 2, 'B' union allSelect 3, 'C'Declare @Str Varchar(1000)select @str = COALESCE ( @str + ',' , '' ) + Col1 from @TSelect @Str |
 |
|
|
|
|
|