sql=sql&" from Gq_sfdata,Gq_GameType where Gq_sfdata.gameid=Gq_GameType.id"
sql=sql&" and Gq_sfdata.ulock=1 and Gq_sfdata.fine=1 and Gq_sfdata.gameid="&indexsf&" order by Gq_sfdata.hour,Gq_sfdata.minute"
l=ubound(str) '获取前面数组的最大下标
for i=0 to num-1
randomize()
n=int((l-0+1)*rnd(now())+0)
s1=s1&s(n)&"," '把获取到的ID值组合成一个字符串(这里有num个随机ID)
next
s1=left(s1,len(s1)-1) '去掉字符串最后一个逗号
4.然后,就可以写sql语句了
sql="select * from table where ID in("& s1 &")"