From: Date: October 4 2007 10:42am Subject: LIMIT within GROUP BY List-Archive: http://lists.mysql.com/mysql/209383 Message-Id: <4704A75B.8030001@monkevic.info> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hello, MySQL 4.1 I have query: SELECT SUM(points) as ranking FROM results GROUP BY person_id ORDER BY ranking DESC My goal is to sum 7 greatest results for each person. In more general, my question is: is there a way to limit number of records within groups in "group by" query. Thank you! -- Best regards, Miroslav Monkevic