SELECT * FROM Project_Business_Type WHERE Id in (10,25,5,4,15,46,74,500) order by charindex(‘,‘+ltrim(Id)+‘,‘, ‘,10,25,5,4,15,46,74,500,‘)
这里查询出来的结果就是按参数传进来的顺序,10,25,5,4...
order by charindex(‘,‘+ltrim(Id)+‘,‘, ‘,10,25,5,4,15,46,74,500,‘) 排列顺序
时间: 2024-10-13 16:30:16