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

asp.net - Javascript/DOM Why is does my form not support submit()? -

sockets - Delphi: TTcpServer, connection reset when reading -

javascript - Classic ASP "ExecuteGlobal" statement acting differently on two servers -