title: Get Top N results for each column value
body: <p>I've got a table like this:</p>
  
  <pre><code>+--------+--------+
  |  name  |  kind  |
  +--------+--------+
  | cat    | animal |
  | dog    | animal |
  | horse  | animal |
  | ant    | animal |
  | bird   | animal |
  | tree   | plant  |
  | grass  | plant  |
  | carrot | plant  |
  |                 |
  |     ... etc.    |
  +--------+--------+
  </code></pre>
  
  <p>How can I get Top N items of each <strong>kind</strong>? E.g. N=2:</p>
  
  <pre><code>+--------+--------+
  |  name  |  kind  |
  +--------+--------+
  | ant    | animal |
  | bird   | animal |
  | carrot | plant  |
  | grass  | plant  |
  +--------+--------+
  </code></pre>
  
  <p>Thanks in advance!</p>