title: How to join id occurrences instead of simply showing count(*)?
body: <p>I did this snippet to demonstrate: <a href="http://sqlfiddle.com/#!6/ed243/2" rel="nofollow">http://sqlfiddle.com/#!6/ed243/2</a></p>
  
  <p>Schema:</p>
  
  <pre><code>create table professional(
    id int identity(1,3) primary key,
    name varchar(20)
  )
  insert into professional values('professional A')
  insert into professional values('professional B')
  insert into professional values('professional C')
  
  create table territory(
    id int identity(2,3) primary key,
    name varchar(20)
  )
  insert into territory values('territory A')
  insert into territory values('territory B')
  insert into territory values('territory C')
  
  create table panel(
    id int identity(3,3) primary key,
    idProfessional int not null,
    idTerritory int not null,
  )
  insert into panel values(1, 2)
  insert into panel values(4, 5)
  insert into panel values(7, 8)
  insert into panel values(1, 5)
  insert into panel values(7, 8)
  insert into panel values(7, 2)
  </code></pre>
  
  <p>And the query I've got so far:</p>
  
  <pre><code>select 
      p.id, p.name, count(*) as Territories
  from 
      (select distinct idProfessional, idTerritory from panel) panel
  inner join
      professional p 
      on p.id = panel.idProfessional
  group by 
      p.id, 
      p.name
  having count(*) &gt; 1
  order by p.id
  </code></pre>
  
  <p>The above query shows as result in how many territories each <em>professional</em> works  filtering with <em>distinct</em> and by showing only professionals that work in more than one territory with <em>having</em>:</p>
  
  <pre><code>-------------------------------------------------------
  |    id    |    name              |    Territories    |
  -------------------------------------------------------
  |    1     |    professional A    |    2              |
  |    7     |    professional C    |    2              |
  -------------------------------------------------------
  </code></pre>
  
  <p>Ok, but.. is it possible to show in <code>Territories</code> each <em>idTerritory</em> joined like <code>"2, 5"</code> instead of <code>count(*)</code> ?</p>
  
  <p>Thanks in advance.</p>