MySQL answer.
Re: How do I select the highest 20 to 30 values?
The idea is always the same and can be adjusted to select any position. First you have to order the query and select the first 19 values (Let's say we want the 20th to 30th highest score in a competition). Then exclude the first 19 rows, and return the next 10 rows. This will give you the 20th to 30th highest score.
SELECT * FROM competition WHERE id NOT IN (SELECT id FROM competition ORDER BY score DESC LIMIT 19) ORDER BY score DESC LIMIT 10
|