From: Steve Edberg Date: March 29 1999 10:36am Subject: Re: select largest List-Archive: http://lists.mysql.com/mysql/1131 Message-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" At 7:20 PM -0800 3/28/99, wrote: >I have a database with a column defined as: >NOT NULL AUTO_INCREMENT >Is there a simple SELECT statement to grab the 5 largest entries? > >thanks >-Lkb > > >--------------------------------------------------------------------- >Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" before ...............^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Most specifically, see the LIMIT clause in http://www.mysql.com/Manual_chapter/manual_Reference.html#SELECT for example, SELECT * ORDER BY column LIMIT 5 errr...make that SELECT * ORDER BY column DESC LIMIT 5 -sbe- +--------------- my people are the people of the dessert, ---------------+ | Steve Edberg Computer Consultant | | sbedberg@stripped University of California, Davis | | (530)753-7605 (530)754-9127 | +---------------- said t e lawrence, picking up his fork ----------------+