asp script:
randomize
sql="select max (ID) as maxid from table"rs.open sql,cn
max=rs("maxid")
rs.close
for i=0 to 100
rndNum=int(rnd()*max)+1
idstr=idstr&rndNum&","
next
idstr=idstr+"0"
sql="select top 25 ID, * from table where ID in ("+idstr+")"
rs.open sql,cn
<% randomize sql="select max (ID) as maxid from table" rs.open sql,cn max=rs("maxid") rs.close for i=0 to 100 rndNum=int(rnd()*max)+1 idstr=idstr&rndNum&"," next idstr=idstr+"0" sql="select top 25 ID, * from table where ID in ("+idstr+")" rs.open sql,cn %>
Friday, July 14, 2006
SELECT random records from a database
Posted by RamiX at 7:43 PM
Labels: asp, asp.net, php, source codes, sql, windows programming
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment