title: mySQL - query to group values together
body: <p>I have a query (below) which returns and ID value and two additional associated values (ReplacesReference). The query returns 2 records. I want to return one record so I need to concatenate the first "ReplacesReference" value with a comma ',' and the second "ReplacesReference" value.</p>
  
  <p>my query is as follows  </p>
  
  <pre><code>    select 
      distinct(c.wiid) as ID,    
      a.reference as ReplacesReference
      from npp_projects a, 
      npp_assoc b, 
      npp_projects c
      where a.id = b.parent_id     
      and b.type = 'replace' 
      and c.id = b.child_id
     and c.reference like '%EN 815%'
  </code></pre>
  
  <p>Its output is :</p>
  
  <pre><code>ID          |   ReplacesReference
  ====================================
  CEN3406     |   I.S. EN 815:1996
  CEN3406     |   I.S. EN 815:2004
  </code></pre>
  
  <p>I want to be able to return the below output:</p>
  
  <pre><code>ID                | ReplacesReference
  ====================================
  CEN3406           |  I.S. EN 815:1996 , I.S. EN 815:2004
  </code></pre>
  
  <p>Many thanks in advance for your help - I am tearing my hair out with this one !</p>