MySQL Forums
Forum List  »  Newbie

Order and limit not working as expected
Posted by: Drew Burchett
Date: July 19, 2005 08:09AM

I have a fairly simple table that stores a huge amount of data. I am displaying this data through perl on a web page, and due to the number of records, I am using the LIMIT clause to page the data. However, when I attempt to use an ORDER clause along with the LIMIT clause, it is not working as expected.

SELECT * FROM quarantine ORDER BY to_address, quarantine_date LIMIT 0, 25

The above query returns the first 25 rows in the order specified by the query. What I need is the entire table sorted, then the first 25 rows returned. How would I accomplish that?

Options: ReplyQuote


Subject
Written By
Posted
Order and limit not working as expected
July 19, 2005 08:09AM


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.