title: Mysql query In QUERY with only 1 result for each in id
body: <p>Please excuse the vagueness of my title, I really don't know how to succinctly write what I am trying to do.</p>
  
  <p>I have a table with </p>
  
  <p>name - str
  item_id - int
  position - int</p>
  
  <pre><code>  name        item_id   position
  | 6asd |          17 |        1 |
  | asdf |           3 |        1 |
  | asdf |           3 |        2 |
  | asdf |           3 |        3 |
  | asdf |           3 |        4 |
  </code></pre>
  
  <p>I am trying to use an IN query on a list of <code>item_ids</code> and only return 1 row per item and that should be the row with the lowest position.</p>
  
  <pre><code>select name, item_id, position from my_table 
  WHERE item_id IN (17, 3) AND name != '';
  </code></pre>
  
  <p>This returns all rows for the item_id when I am only trying to return the lowest position.  Naturally I looked at ORDER_BY and LIMIT but my query only is done on the whole results set not on each id individually. </p>
  
  <p><code>ORDER BY position ASC LIMIT 1</code></p>
  
  <p>Has anyone tried to do this before?? any help would be greatly appreciated. Do I need to use a subselect somehow? </p>