On Tue, Jan 6, 2009 at 3:13 PM, Jerry Schwartz <jschwa...@the-infoshop.com> wrote: > Each account has multiple customers, and each customer has multiple sales. I > want to get the top 20 customers for each account.
http://www.xaprb.com/blog/2006/12/07/how-to-select-the-firstleastmax-row-per-group-in-sql/ Keep reading, it talks about top N per group later on in the post. "Select the top N rows from each group" -- Baron Schwartz, Director of Consulting, Percona Inc. Our Blog: http://www.mysqlperformanceblog.com/ Our Services: http://www.percona.com/services.html -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/mysql?unsub=arch...@jab.org