select * from AAA where ID in (2,5,3)
我希望出来结果的顺序跟in里面的顺序一样, 不知道有没有办法实现?
------解决方案--------------------
select * from
(select 1 as ranknum, * from AAA where ID in (2)
union
select 2 as ranknum,* from AAA where ID in (5)
union
select 3 as ranknum,* from AAA where ID in (3) )a
order by ranknum