select * from test where id in( 2,1,3)
我想要搜索出来的结果能根据in里面的ID进行排序
既按照 id
2
1
3
知道可以通过以下实现
select * from test where id = 2
union all
select * from test where id = 1
union all
select * from test where id = 3
但跪求更简单高效的方法
...全文
1277打赏收藏
一句SQL问题
一张 很简单的表 test id no 1 a11 2 b22 3 b33 4 b44 select * from test where id in( 2,1,3) 我想要搜索出来的结果能根据in里面的ID进行排序 既按照 id 2 1 3 知道可以通过以下实现 select * from test where id = 2 union all select * from test where id = 1 union all select * from test where id = 3 但跪