I’ve got a table like this:
+--------+--------+
| name | kind |
+--------+--------+
| cat | animal |
| dog | animal |
| horse | animal |
| ant | animal |
| bird | animal |
| tree | plant |
| grass | plant |
| carrot | plant |
| |
| ... etc. |
+--------+--------+
How can I get Top N items of each kind? E.g. N=2:
+--------+--------+
| name | kind |
+--------+--------+
| ant | animal |
| bird | animal |
| carrot | plant |
| grass | plant |
+--------+--------+
Thanks in advance!
Here is a SqlFiddle demo: