How can I select the 100 largest rows in a table based on a column 'score'?
I can find the largest score in the 'score' column with:
SELECT max(score) FROM mTable
And then obtain that row(s):
SELECT * FROM mTable WHERE score=largestScore
But how would I wrap this up and obtain the following 99 lower scored rows?
Thanks.
Use:
SELECT t.*
FROM MTABLE t
ORDER BY t.score DESC
LIMIT 100
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With