How to reverse the default ordering in Mysql?

前端 未结 5 1489
名媛妹妹
名媛妹妹 2020-12-20 18:29

In Mysql, when you execute a select SQL statement, there is a default ordering if you don\'t include a sorting clause, how to reverse the default ordering? Just add DE

5条回答
  •  情书的邮戳
    2020-12-20 19:06

    I think you would be better served by specifying the order you actually want. Tables, by their nature, have no order. It is probably just displayed in the order in which the rows were inserted - though there's no guarantee it will stay in that order.

    Chances are, you probably just want to add this:

    ORDER BY id DESC
    

    ...since most of the time, people use an auto-incrementing field called "id"

提交回复
热议问题