I have a table with some records with fields like name, rating etc.
I first want to sort based on rating limiting results to 20 and then on this resultset want to furthe
This query should do the trick:
SELECT * FROM (SELECT * FROM table ORDER BY rating DESC LIMIT 20) ORDER BY name