1.默认下,使用select xxx where in(xx,xx)查询,返回结果是按主键排序的,如果要按in()中值的排列顺序,可以这样做:
 
select * from talbe where id in(3,2,4,1) ORDER BY FIND_IN_SET( id, '3,2,4,1') 
本文转自http://blog.chinaunix.net/uid-20304312-id-1707798.html 感谢作者

相关文章:

  • 2021-12-01
  • 2021-07-03
  • 2021-12-31
  • 2021-12-18
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-04
猜你喜欢
  • 2022-12-23
  • 2021-12-17
  • 2022-02-05
  • 2021-12-09
  • 2022-02-09
  • 2022-01-27
相关资源
相似解决方案