1

Possible Duplicate:
Simulating group_concat MySQL function in MS SQL Server 2005?

My query looks like this:

select analyst, issuer, coveragegroup
from analystcoverage

There can be multiple analysts for a particular issuer. When this is the case, I want to concatenate their names in a single record.

I want these two records:

John Doe      Walmart      Fixed Income
Bill Jones    Walmart      Fixed Income

to be returned as:

John Doe; Bill Jones      Walmart      Fixed Income
Community
  • 1
  • 1
user1171915
  • 89
  • 1
  • 2
  • 11

1 Answers1

0

One option would be to use COALESCE. I know how to use it, but I'm not sure how to tell it to only concatenate records with equal values. Here's the code to get you started:

Concatenate many rows into a single text string?

Community
  • 1
  • 1
Jared
  • 878
  • 3
  • 11
  • 19