title: how to concatenate values of a column if the other columns have the same value
body: <p>I have a query</p>
  
  <pre><code>SELECT
      cc.contact_id,
      cc.name,
      ct.name AS contact_type
  FROM
      contacts AS c
      LEFT JOIN contact_companies AS cc ON c.contact_id = cc.contact_id
      LEFT JOIN contacts_to_types AS ctt ON cc.contact_id = ctt.contact_id
      LEFT JOIN contact_types AS ct ON ctt.contact_type_id = ct.contact_type_id
  WHERE
       cc.name LIKE '%p%'
  ORDER BY name, contact_id
  </code></pre>
  
  <p>which returns:</p>
  
  <pre><code>+------------+--------------------------------+--------------+
  | contact_id | name                           | contact_type |
  +------------+--------------------------------+--------------+
  |        297 | Primary Properties Corporation | Supplier     |
  |        297 | Primary Properties Corporation | Prospect     |
  |        297 | Primary Properties Corporation | Customer     |
  |        298 | San Miguel Corporation         | Prospect     |
  |        301 | Sulpicio Lines                 | Supplier     |
  +------------+--------------------------------+--------------+
  </code></pre>
  
  <p>when I would like it to return:</p>
  
  <pre><code>+------------+--------------------------------+------------------------------+
  | contact_id | name                           | contact_type                 |
  +------------+--------------------------------+------------------------------+
  |        297 | Primary Properties Corporation | Supplier, Prospect, Customer |
  |        298 | San Miguel Corporation         | Prospect                     |
  |        301 | Sulpicio Lines                 | Supplier                     |
  +------------+--------------------------------+------------------------------+
  </code></pre>
  
  <p>that is, I'd like it to combine the <code>contact_type</code> of 297.</p>
  
  <p>Is this possible? Could someone please show me how? :)</p>
  
  <p>Thanks</p>