(在SQLserver环境下测试通过)

数值型:
select * from table where id in(1,2,3,4) order by charindex(','+ltrim(rtrim(str(id)))+',',',1,2,3,4,')

字符型:
select * from table where usn in('aaa','bbb','ccc','ddd') order by charindex(usn,'aaa,bbb,ccc,ddd')

相关文章:

  • 2022-12-23
  • 2021-11-19
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-09
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-12-29
  • 2021-04-28
  • 2022-12-23
  • 2021-12-31
相关资源
相似解决方案