MySQL Forums
Forum List  »  Newbie

Predicting SORT BY
Posted by: Brian Gordon
Date: April 27, 2005 04:09PM

I have a very large table that is always sorted by the primary key when I SELECT data from it. Actually, the very purpose of the data being in a database is so that it can be sorted like that. I was wondering, however, if there's some way to use the WHERE clause in SELECT (or a seperate token) to actually give me, say, the 10000th entry -if it were to be sorted-. Something along the lines of:
SELECT name FROM data WHERE %place% = 10000 SORT BY income DESC

So basically if I had a database of names and their incomes, I would need to find the name that has the 10000th highest income. Can anyone help me out?

Options: ReplyQuote


Subject
Written By
Posted
Predicting SORT BY
April 27, 2005 04:09PM
April 28, 2005 01:46AM
May 02, 2005 04:38PM
May 02, 2005 04:40PM


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.