title: Using count, groupBy, as in Slick
body: <p>How can I convert this sql statement to Slick in most precise, optimal way.</p>
  
  <pre><code>select t.*, count(v.userId) as vote from Talk t inner join Vote v on t.id = v.talkId group by t.id
  </code></pre>
  
  <p>v.<strong>talkId</strong> column is a <strong>Foreign Key</strong> to <strong>id</strong> column of Talk</p>
  
  <p>Talk Model:</p>
  
  <ul>
  <li><strong>id</strong></li>
  <li>description</li>
  <li>speaker_id</li>
  <li>pledged_date</li>
  <li>create_date_time</li>
  <li>locked_date</li>
  <li>is_approved</li>
  </ul>
  
  <p>Vote Model:</p>
  
  <ul>
  <li>user_id</li>
  <li><strong>talk_id</strong></li>
  </ul>
  
  <p>I tried this however it throws exception <em>SlickException: Cannot select Path s2 in Ref s3</em> </p>
  
  <pre><code>val x = for {
        t &lt;- models.slick.Talks
        v &lt;- models.slick.Votes if t.id === v.talkId
      } yield (t, Query(models.slick.Votes).filter(_.talkId === t.id).length)
  
  val y = x.groupBy(_._1.id)
  </code></pre>