日期:2014-05-18  浏览次数:20499 次

Sql Server根据给的ID顺序排序
比如下面的查询语句
select # from A where Bid in ('3','1','2','5')
而我查出来的结果就是需要根据他的Bid排序
且顺序和括号里面的顺序要一样

sql原型是下面这样的

select * from A where Bid in (select id from B)

------解决方案--------------------
select # from A where Bid in ('3','1','2','5')
order by ('3','1','2','5')