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 |
|
ponnurajs
Starting Member
6 Posts |
Posted - 2007-03-02 : 06:08:58
|
| Hai, I need a query to conatenate same column values available in 3 records. ie., My record like this. Name Item Raj A Raj B Raj C My output will be Raj A,B,C whether this is possible with in a single query. Any one can help me for this. Thanks in advanceRegards,Raju. |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
|
|
mahesh_bote
Constraint Violating Yak Guru
298 Posts |
Posted - 2007-03-02 : 08:30:10
|
| try this ...create table #test(num numeric,txt varchar(10))insert into #test select 1, 'A'unionselect 1, 'B'unionselect 1, 'C'declare @str varchar(50)select @str = case when @str is null then txt else @str + ', ' + txt end from #testselect num, @str as txt from #testgroup by numdrop table #testMahesh |
 |
|
|
|
|
|