title: MySQL Group By with top N number of each kind
body: <p>I have a table like this:</p>
  
  <pre>
  Rank      Letter
  1         A
  2         A
  3         B
  4         A
  5         C
  6         A
  7         C
  8         C
  9         B
  10        C 
  </pre>
  
  <p>And I need the top 2 of each letter ordered by ascending rank:</p>
  
  <pre>
  Rank      Letter
  1         A
  2         A
  3         B
  5         C
  7         C
  9         B
  </pre>
  
  <p>How would I do it? It's fairly straightforward to get just the top 1 using GROUP BY, but I can't seem to get it working for multiple entries</p>