title: SQL join and group items as an array
body: <p>I have the following SQL</p>
  
  <pre><code>SELECT articles.id, articles.title, tags.name AS tags
  FROM articles
  LEFT JOIN article_tag_association ON articles.id = article_tag_association.article_id
  LEFT JOIN tags ON tags.id = article_tag_association.tag_id
  </code></pre>
  
  <p>This works OK except it creates a row for each tag an article has, which messes with the limit</p>
  
  <p>e.g.</p>
  
  <pre><code>[
   "0" =&gt; ["id" =&gt; "1", "title" =&gt; "test", "tags" =&gt; "tag1"],
   "1" =&gt; ["id" =&gt; "1", "title" =&gt; "test", "tags" =&gt; "tag2"],
   "2" =&gt; ["id" =&gt; "2", "title" =&gt; "test2", "tags" =&gt; "tag1"],
  ]
  </code></pre>
  
  <p>(only 2 articles but three rows)</p>
  
  <p>is there a way to make it return each article with an array of tags?</p>
  
  <p>something like:</p>
  
  <pre><code>[
   "0" =&gt; ["id" =&gt; "1", "title" =&gt; "test", "tags" =&gt; ["tag1", "tag2"]],
   "1" =&gt; ["id" =&gt; "2", "title" =&gt; "test2", "tags" =&gt; ["tag1"]],
  ]
  </code></pre>