sql - Mysql Ordering Query -


Hello I want to run a query to get the last five records from a table, but in the reverse order Currently I have:

  $ query = "ID DESC limit 5 by SELECT ORDER";  

Which I do not like.

For example, if there are last five records

15 16 17 18 19

I want them to return

15 16 17 18 19

No 1918 17 16 15 which is given above.

How do I achieve this? If I change ASC to DESC then it gives 1 2 3 4 5, which does not work either.

  SELECT * (SELECT * Table ID to ID DESC limit 5) AS TMP ORDER BY ASC  

Comments

Popular posts from this blog

MySql variables and php -

url rewriting - How to implement the returnurl like SO in PHP? -

Which Python client library should I use for CouchdB? -