SQL query for top 100 displayed in reverse order

I need help with what should be a simple request!

Logotype database, 18K strong. Each logo has a rating. I want to select the top 100 points and display them from 100 to 1, and not from 1 to 100.

My request:

SELECT * FROM tbllogos WHERE status = 'live' ORDER BY score DESC LIMIT 100 

which is great for choosing the 100 best, but the php WHILE loop shows them from 1 to 100. I can't figure out how to change the order so that it displays 100 to 1. Changing DESC to ASC is obviously the answer that selects 100 with the smallest points.

Help rate!

+5
source share
1 answer

Use subquery:

 SELECT t.* FROM (SELECT * FROM tbllogos WHERE status = 'live' ORDER BY score DESC LIMIT 100 ) t ORDER BY score ASC; 
+5
source

All Articles