title: MySQL JOIN with LIMIT 1 on joined table
body: <p>I want to join two tables, but only get 1 record of table2 per record on table1</p>
  
  <p>For example:</p>
  
  <pre><code>SELECT c.id, c.title, p.id AS product_id, p.title
  FROM categories AS c
  JOIN products AS p ON c.id = p.category_id
  </code></pre>
  
  <p>This would get me all records in <code>products</code>, which is not what I want. I want 1 [the first] product per category (I have a <code>sort</code> column in the products field).</p>
  
  <p>How do I go about doing that?</p>