比如:
set @str='2,1,3,5,4'
select t from R_info where id in (@str)
得出的结果排序是按1,2,3,4,5排的。。
[email protected]??忙。。。
------解决方案--------------------
- SQL code
select t from R_info where charindex(','+ltrim(id)+',',',[email protected]+',')>0
------解决方案--------------------
- SQL code
select t from R_info where charindex(','+ltrim(id)+',',',[email protected]+',')>0 order by charindex(','+ltrim(id)+',',',[email protected]+',')