MySQL 下不规则排序
程序员文章站
2022-03-27 20:22:10
...
SQL查询语句如下:select * from table where (ID = 10) or (ID = 32) or (ID = 22) or (ID = 76) or (ID = 13) or (ID = 44)让结
SQL查询语句如下:
select * from table where (ID = 10) or (ID = 32) or (ID = 22) or (ID = 76) or (ID = 13) or (ID = 44)
让结果按10,32,22,76,13,,44的顺序检索出来,请问如何书写? (sql能力)
select * from table where (ID = 10) or (ID = 32) or (ID = 22) or (ID = 76) or (ID = 13) or (ID = 44) order by field(ID,10,32,22,76,13,44)
上一篇: 也谈linux桌面