SQL 2005 Merge / concatenate multiple rows to one column

Posted by Dave on Stack Overflow See other posts from Stack Overflow or by Dave
Published on 2010-05-13T15:35:07Z Indexed on 2010/05/13 15:54 UTC
Read the original article Hit count: 232

Filed under:
|
|

Hi,

We have a bit of a SQL quandry. Say I have a results that look like this...

61E77D90-D53D-4E2E-A09E-9D6F012EB59C | A
61E77D90-D53D-4E2E-A09E-9D6F012EB59C | B
61E77D90-D53D-4E2E-A09E-9D6F012EB59C | C
61E77D90-D53D-4E2E-A09E-9D6F012EB59C | D
7ce953ca-a55b-4c55-a52c-9d6f012ea903 | E
7ce953ca-a55b-4c55-a52c-9d6f012ea903 | F

is there a way I can group these results within SQL to return as

61E77D90-D53D-4E2E-A09E-9D6F012EB59C | A B C D
7ce953ca-a55b-4c55-a52c-9d6f012ea903 | E F

Any ideas people?

Many thanks

Dave

© Stack Overflow or respective owner

Related posts about sql

Related posts about sql-server-2005