title: MySQL return first row of a joined table
body: <p>I have two tables (country &amp; ducks) where the country table has every country in the world and the ducks table has a list of ducks with a country_id field to link to the main country.</p>
  
  <p>I'm trying to get a list of only countries with at least one duck in it and with that a single matching record from the ducks table for the highest rated duck within that country. So far I have:</p>
  
  <pre><code>SELECT *
  FROM country c 
  INNER JOIN ducks d ON c.id = d.country_id
  ORDER BY c.country ASC, d.rating DESC
  </code></pre>
  
  <p>This returns a list of every duck rather than just one per country.</p>
  
  <p>I'd be grateful if anyone can point me in the right direction here. I'd rather do it in SQL than have a separate query for each country to pull out the top rated duck.</p>