title: MySQL concatenate values from one table into a record of another
body: <p>I have three tables (many to many relationship): <code>items</code>, <code>items_to_tags</code>, and <code>tags</code>. The <code>items</code> and <code>tags</code> tables have a unique ID column, and the <code>items_to_tags</code> table has columns <code>item_id</code> and <code>tag_id</code>. Is there a way to select all results from the <code>items</code> and <code>tags</code> tables, but with all results merged into the same record?</p>
  
  <p>For instance, if I have this data:</p>
  
  <ul>
  <li><p><code>items</code>:</p>
  
  <pre><code>id     name
  1      'item1'
  2      'item2'
  </code></pre></li>
  <li><p><code>tags</code>:</p>
  
  <pre><code>id     name
  1      'tag1'
  2      'tag2'
  3      'tag3'
  </code></pre></li>
  <li><p><code>items_to_tags</code>:</p>
  
  <pre><code>item_id    tag_id
  1          1
  1          2
  1          3
  2          3
  </code></pre></li>
  </ul>
  
  <p>The result of the query should be:</p>
  
  <pre><code>item_id   item_name   tags
  1         'item1'     'tag1,tag2,tag3'
  </code></pre>