我有這樣的一個表:獲得前N個結果爲每列值
+--------+--------+
| name | kind |
+--------+--------+
| cat | animal |
| dog | animal |
| horse | animal |
| ant | animal |
| bird | animal |
| tree | plant |
| grass | plant |
| carrot | plant |
| |
| ... etc. |
+--------+--------+
我怎樣才能得到每個樣的前N個項目?例如。 N = 2:
+--------+--------+
| name | kind |
+--------+--------+
| ant | animal |
| bird | animal |
| carrot | plant |
| grass | plant |
+--------+--------+
在此先感謝!
可能重複(http://stackoverflow.com/questions/1895110/row-number-in-mysql) – podiluska