title: Get row instead of column when using MIN in MySQL?
body: <p>I have a problem with a MySQL query, since I'm trying to retrieve multiple columns (or the whole row) when using <code>MIN()</code> at a joined table column.</p>
  
  <p>I'll try to make my question more clear with an example, I left out a lot of joins and stuff that aren't necessary:</p>
  
  <pre><code>SELECT
      product.*,
      MIN(stock.qty)
  FROM
      product
  LEFT JOIN
      stock ON product.id = stock.id
  GROUP BY
      product.id
  </code></pre>
  
  <p>The result I'm getting is now the whole product row, and the <code>stock.qty</code> column, but I want to retrieve the whole <code>stock</code> row of the entry with the least qty.<br>
  This probably can't be accomplished using <code>MIN()</code>, but my question is, how can I make this happen?</p>
  
  <p>Thanks in advance</p>
  
  <p>UPDATE:
  Here's an SQL fiddle for some more explanation:</p>
  
  <p>You'll see here that <code>Product A</code> joins the qty of stock item <code>2</code>, which is correct, it's 10, the other stock item of product A is 15. But, I also want to retrieve the <code>backorders</code> field <strong>of that same row</strong>, which is <code>1</code>, but my query returns <code>0</code> as backorder, which is from stock row <code>1</code>:</p>
  
  <p><a href="http://sqlfiddle.com/#!9/b232e/3/0" rel="nofollow">http://sqlfiddle.com/#!9/b232e/3/0</a></p>