参见下属范例代码:

select * from table1 where id in (3,45,123,54,2) 

order by  charindex(','+cast(id as varchar)+',',',3,45,123,54,2,')
或者也可以是
order by  case when id when 3 then 1 when 45 then 2 when 123 then 3 when 54 then 4 when 2 then 5 end

相关文章:

  • 2021-12-25
  • 2022-12-23
  • 2022-12-23
  • 2021-07-13
  • 2022-12-23
  • 2022-12-23
  • 2021-08-22
  • 2021-12-15
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-01-06
  • 2022-12-23
  • 2021-08-27
  • 2022-12-23
相关资源
相似解决方案