SQL数据库中抽取数据出现相同的项

来源:百度知道 编辑:UC知道 时间:2024/05/31 17:35:35
为什么我老是在9 10项的内容相同!!我都崩溃了这是什么原因望高手赐教
下面为代码
randomize
sid=int(maxtype1*rnd+1)
set rst=conn.execute("select * from rightorwrong where rightorwrongid="&sid)

while rst.eof
randomize

sid=int(maxtype1*rnd+1)
set rst=conn.execute("select * from rightorwrong where rightorwrongid="&sid)

这样查找效率可以很高,你的程序有问题!!从网上找的吧
dim num(20)
dim sum(20)
for z=1 to maxtype1
sum(z)=z
next

for x=1 to pd
randomize
sid =int((maxtype1*rnd())+1)
num(x)=sum(sid)
for y=sid to maxtype1
sum(y)=sum(y+1)
next
maxtype1=maxtype1-1
next

set rst=conn.execute("select * from rightorwrong where rightorwrongid="&num(i))

randomize timer