set rs=server.createobject("adodb.recordset")
sqlk="select * from product where id in (1,3,5,7,9)"
rs.open sqlk,conn,1,1请问怎样能从数据库读数据按in数组中的次序读啊?高手帮忙啊!

解决方案 »

  1.   

    select * from product where id in (1,3,5,7,9) order by id asc
      

  2.   

    select * from product where id =1
    union
    select * from product where id =3
    union
    select * from product where id =5
    union
    select * from product where id =7
    union
    select * from product where id =9
    union
      

  3.   

    谢谢各位,我得备注一下: 
    set rs=server.createobject("adodb.recordset") 
    sqlk="select * from product where id in ("&rk&")" 
    rs.open sqlk,conn,1,1 
    上面是我的原码,rk是一个数组,无序的,个数也不确定,是从数据库中读的一个字段。