step 一: sql="select id from table" 结果用存在 rs=conn.execute(sql)
step 二: 生成一个 step1的最大值(rs.recordcount)内的随机数字. N个
code:
<%Randomize %>
<%
dim r(10)
for i=0 to UBound(r)
r(i)=int(Rnd()*100)
int(Rnd()*100)
%>
step 三: 将数组联合 join成一个","分割的
代码如下:
<%Randomize %>
<%
sql="select id from table"
rs=conn.execute(sql)
maxrecord=rs.recordcount
dim r(10)
for i=0 to ubound(r)
r(i)=rs(int(rnd()*maxrecord))
next
s=join(r,",")
sql="select * from table where id in("&s&")"
newrs=conn.execute(sql)
%>
11
22
33