MySQL Forums
Forum List  »  Oracle

Re: how us top-n queries in mysql
Posted by: Sarah Sproehnle
Date: August 31, 2006 08:07PM

Maruti,

I believe you want to use ORDER BY and LIMIT. For example, to retrieve the 10 greatest populations from a table of city information you could:

SELECT * FROM city ORDER BY population DESC LIMIT 10;

Sarah Sproehnle
MySQL AB
www.mysql.com

Options: ReplyQuote


Subject
Views
Written By
Posted
6956
July 04, 2006 03:48AM
Re: how us top-n queries in mysql
3249
August 31, 2006 08:07PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.