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 |
arkiboys
Master Smack Fu Yak Hacker
1433 Posts |
Posted - 2012-03-14 : 04:26:14
|
Hi,This is my table with some test data as follows:tblMainID ValueField------------------122 'value1'122 'value2'122 'value3'...432 'somevalue'...Question:How can I returnID ValueField------------------122 'value1', 'value2', 'value3'...432 'somevalue'Thanks |
|
GilaMonster
Master Smack Fu Yak Hacker
4507 Posts |
Posted - 2012-03-14 : 04:47:50
|
Read up on FOR XML PATH as a method of string concatenation. There's a good article at Simple-talk.com--Gail ShawSQL Server MVP |
 |
|
nasim.sona
Starting Member
7 Posts |
Posted - 2012-03-14 : 05:45:36
|
your requirement is something which requires aggregate function to concatenate , but unluckily we don't have such function in sql-server (or I am not aware).select id,concatenateall(valuefield) from tablegroup by id-Nasim |
 |
|
|
|
|