Let's say that column my_value is your criteria of ordering rows. Then:
SELECT * FROM your_table a
WHERE 10>(SELECT COUNT(*) FROM your_table b
WHERE b.my_value>a.my_value); will retrieve the firsts 10 rows (i.e. the rows which have no more than 9 superiors).
This should work for unique values of my_value column, for repeating values there are many scenarios.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.