“ where in ” mysql clause

前端 未结 5 787
梦毁少年i
梦毁少年i 2021-01-02 19:36

i used a mysql query where there is \"where id in (\"22,20,21\") \" but when i get the result its like array ordered in asecending order ie 20,21,20

but i need it i

5条回答
  •  佛祖请我去吃肉
    2021-01-02 20:39

    In general, the database system returns the results in whatever order it feels like. If you want it to be ordered, you have to tell it. This blog post provides one method for doing so; you may be able to find other solutions online.

提交回复
热议问题