title: mysql: How to INNER JOIN a table but limit join to 1 result with the highest vote or count?
body: <p>I have 2 tables. One is items and another is votes for those items.</p>
  
  <pre><code>Items table has: |item_id|name|post_date
  Votes table has: |votes_id|item_id|answer|total_yes|total_no
  </code></pre>
  
  <p>What I want to do is show all items based on post_date and show the answer in the votes table with the HIGHEST total_yes. So I want to show only a SINGLE answer from the votes table with the highest total_yes vote.</p>
  
  <p>I was trying:</p>
  
  <pre><code>SELECT a.*, b.* FROM Items a
  INNER JOIN Votes b ON a.item_id = b.item_id
  GROUP by a.item_id
  ORDER by a.post_date DESC, b.total_yes DESC
  </code></pre>
  
  <p>But that doesnt work. </p>
  
  <p>The result I would like to see is:</p>
  
  <pre><code>&lt;item&gt;&lt;answer&gt;&lt;yes votes&gt;
  Buick | Fastest | 2 yes votes
  Mercedes | Shiny | 32 yes votes
  Honda | Quick | 39 yes votes
  </code></pre>
  
  <p>Any help is appreciated!</p>