From: Rik Wasmus Date: December 5 2011 10:20am Subject: Re: How to get a specific number of entries per one key ? List-Archive: http://lists.mysql.com/mysql/226447 Message-Id: <201112051120.16458.rik@grib.nl> MIME-Version: 1.0 Content-Type: Text/Plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Taking the question _very_ literal: > A quick guess, or at least a starting point: > > SELECT key, data , SUBSTRING_INDEX(GROUP_CONCAT(data ORDER BY data SEPARATOR ','),',',2) > FROM myTable > GROUP BY key -- Rik Wasmus