title: Get top n records for each group of grouped results
body: <p>The following is the simplest possible example, though any solution should be able to scale to however many n top results are needed:</p>
  
  <p>Given a table like that below, with person, group, and age columns, how would you <strong>get the 2 oldest people in each group?</strong> (Ties within groups should not yield more results, but give the first 2 in alphabetical order)</p>
  
  <pre>
  +--------+-------+-----+
  | Person | Group | Age |
  +--------+-------+-----+
  | Bob    | 1     | 32  |
  | Jill   | 1     | 34  |
  | Shawn  | 1     | 42  |
  | Jake   | 2     | 29  |
  | Paul   | 2     | 36  |
  | Laura  | 2     | 39  |
  +--------+-------+-----+
  </pre>
  
  <p>Desired result set:  </p>
  
  <pre>
  +--------+-------+-----+
  | Shawn  | 1     | 42  |
  | Jill   | 1     | 34  |
  | Laura  | 2     | 39  |
  | Paul   | 2     | 36  |
  +--------+-------+-----+
  </pre>
  
  <hr>
  
  <p><strong>NOTE:</strong> This question builds on a previous one- <a href="https://stackoverflow.com/q/12102200/165673">Get records with max value for each group of grouped SQL results</a> - for getting a single top row from each group, and which received a great MySQL-specific answer from @Bohemian:</p>
  
  <pre><code>select * 
  from (select * from mytable order by `Group`, Age desc, Person) x
  group by `Group`
  </code></pre>
  
  <p>Would love to be able to build off this, though I don't see how.</p>