title: Complicated SQL query
body: <p>I'm trying to build a specific sql query but i have no idea how to implement what i want.<br>
  My database looks like this:  </p>
  
  <pre><code>Col1 Col2  
  "a"   5  
  "b"   7  
  "a"   8  
  "a"   7  
  "b"   5  
  "b"   7  
  "c"   3  
  "a"   4  
  "b"   3  
  "b"   4  
  "c"   1 
  </code></pre>
  
  <p>And I want a query that returns something like this:  </p>
  
  <pre><code>"a"   8  
  "a"   7  
  "b"   7  
  "b"   7  
  </code></pre>
  
  <p>In words: the 2 highest values of the first x strings.</p>
  
  <p>And only putting a limit after sorting doesn't work, because the order by refers to the whole result and not only to one "group" of the result.
  I hope you understand what i'm up to.</p>