我想在两个表中根据变量i的不同取出符合条件的i条记录怎么做。

解决方案 »

  1.   

    select xx,yy from xxtable  where xx=?? or xx=??  根据i的不同决定xx的多少?
      

  2.   

    select top i fields... from .... where ....
      

  3.   

    "select top " & i & " ...
      

  4.   

    问题在这里 where xx=??1 or xx=??2  中间是 or
      

  5.   

    select top i from xx,yy where xx.filed=yy.filed or 其它条件
      

  6.   

    还没看懂我的意思:假如i=1  xx=??| i=2  xx=??or xx=?? | i=3  xx=??or xx=??or xx =??。。
      

  7.   

    sql="select * from abc where  "
    for i=1 to 10
    sql=sql & " or f='" & i & "''
    next 
    sql=replace(sql,"  "," ")
      

  8.   

    i=1 xx = i; i=2 xx = i or yy = i