title: MySQL query: remove duplicates from ordered list
body: <p>My table is called <code>items</code>. It has the columns <code>item_id</code> and <code>source</code> as well as some other columns.</p>
  
  <p>I want to do a select ordered by <code>item_id</code> but I also want to not have any duplicates in the <code>source</code> column of the result.</p>
  
  <p>What's wrong with this query?</p>
  
  <pre><code>SELECT *
  FROM items
  WHERE item_section='sp_500'
  ORDER BY item_id DESC
  GROUP BY source
  LIMIT 3
  </code></pre>