根据检索条件把检索结果排序。
1、order by中包含的条件在其他数据之前:
select * from 表名
where 列名 in ('条件1','条件2','条件3','条件4')
order by charindex(列名, '条件1,条件2,条件3')
2、order by中包含的条件在其他数据之后:
select * from 表名
where 列名 in ('条件1','条件2','条件3','条件4')
order by
case when charindex(','+列名+',' ,','+'条件1,条件2,条件3,'+',')>=1 then 0 else 1 end