Access数据库的查询
select * from Products where ID in (3783,3784,3780,3781) order by instr(',3783,3784,3780,3781,',',id,') 显示出来的结果是3784,3786,3781,3780Accessasp

解决方案 »

  1.   

    try this,select * from Products 
     where ID in (3783,3784,3780,3781) 
     order by instr(',3783,3784,3780,3781,',ID) 
      

  2.   

    可以是可以。。不过遇到下面这个情况。。又不行了。。select * from Products 
     where ID in (3783,3784,3780,83) 
     order by instr(',3783,3784,3780,83,',ID)
    输出结果是3783,83,3784,3780
      

  3.   

    try this,select * from Products 
     where ID in (3783,3784,3780,3781) 
     order by instr(',3783,3784,3780,3781,',','+str(ID)+',')