title: Return string of minimum length in MySQL database
body: <p>I have a table called "Inventory" with the fields Item (varchar), Amount (int), Type (varchar)</p>
  
  <p>What I would like to extract is rows with the following fields:</p>
  
  <p>Shortest entry in the Item field of all Items of type Type</p>
  
  <p>Sum of all Amounts of all Items of type Type</p>
  
  <p>I have the following:</p>
  
  <pre><code>SELECT Item, sum( Amount ) FROM Inventory GROUP BY Type
  </code></pre>
  
  <p>which gives what I want except it doesn't return the shortest Item, instead it has one of the other Items (the last one it finds I think). By shortest I mean minimum string length.</p>
  
  <p>Thanks for any help.</p>