Rajesh Rajesh - 4 months ago 10
MySQL Question

How to Select first 10 records in mysql

In my database have 100 records but i want only first 10 records in descending order not for whole database in descending order.

Ex:
Database:Records

1,2,3,4,5,6,,7,8,9,10,11,12....................100.


First 10 Records:

10,9,8,7,6,5,4,3,2,1

Answer

You can use this query:

SELECT * FROM (SELECT * FROM table ORDER BY * ASC LIMIT 10) 
ORDER BY * DESC ;
Comments