asp代码翻译

以下代码会随机排序.请问是哪一部分的代码带有随机排序的意思?<scriptlanguage="JavaScript"type="text/JavaScript"><%sq... 以下代码会随机排序.请问是哪一部分的代码带有随机排序的意思?
<script language="JavaScript" type="text/JavaScript">
<%
sql="select count(Gq_sfdata.id) from Gq_sfdata,Gq_GameType where Gq_sfdata.gameid=Gq_GameType.id and Gq_sfdata.ulock=1 and Gq_sfdata.top="&SFstatus&" and Gq_sfdata.gameid="&indexsf&" and datediff('d',Gq_sfdata.Sdate,now())=0 and hour(now)-hour=0 and minute-30<0 and hour(now)<23"
rs.open sql,conn,1,1
rssum=rs(0)
rs.close
%>
theAds=new Array();
shu =<%=rssum%>
dot=''
<%
sql="select Gq_sfdata.id,Gq_sfdata.name,Gq_sfdata.IP,Gq_sfdata.service,Gq_sfdata.Sdate,Gq_sfdata.hour,Gq_sfdata.minute,Gq_sfdata.addr,Gq_sfdata.QQ,Gq_sfdata.xingzhi,Gq_sfdata.homepage,Gq_sfdata.download,Gq_sfdata.gameid,Gq_GameType.game,Gq_sfdata.download,Gq_sfdata.hot from Gq_sfdata,Gq_GameType where Gq_sfdata.gameid=Gq_GameType.id and Gq_sfdata.ulock=1 and Gq_sfdata.top="&SFstatus&" and datediff('d',Gq_sfdata.Sdate,now())=0 and hour(now)-hour=0 and minute-30<0 order by Gq_sfdata.minute desc"
rs.open sql,conn,1,1
nums=rssum
for i=1 to nums
<%
rs.movenext
next
rs.close
%>
theAds2=''
adshu=shu+1
function Quickpick()
{
var ball
for( ball = 1; ball < adshu; ball++)
{
this[ball] = parseInt(Math.random() * shu + 1);
for(var list = 0; list < ball; list++)
{
if(this[list] == this[ball])
{
list = ball;
ball--;
}
}
}
return this;
}
var idx;
var ballball = new Array(shu);
ballball = this.Quickpick();
for(idx = 1; idx < adshu; idx++){
document.write(dot+theAds[ballball[idx]]);
if (idx < shu){document.write('')}}
document.write(dot+theAds2);
</script>
展开
 我来答
xiaoliefengfen
2010-03-08 · TA获得超过236个赞
知道小有建树答主
回答量:383
采纳率:0%
帮助的人:222万
展开全部
sql="select Gq_sfdata.id,Gq_sfdata.name,Gq_sfdata.IP,Gq_sfdata.service,Gq_sfdata.Sdate,Gq_sfdata.hour,Gq_sfdata.minute,Gq_sfdata.addr,Gq_sfdata.QQ,Gq_sfdata.xingzhi,Gq_sfdata.homepage,Gq_sfdata.download,Gq_sfdata.gameid,Gq_GameType.game,Gq_sfdata.download,Gq_sfdata.hot from Gq_sfdata,Gq_GameType where Gq_sfdata.gameid=Gq_GameType.id and Gq_sfdata.ulock=1 and Gq_sfdata.top="&SFstatus&" and datediff('d',Gq_sfdata.Sdate,now())=0 and hour(now)-hour=0 and minute-30<0 order by Gq_sfdata.minute desc"
这段代码是排序的,看样子你不懂sql语言啊
这是一句sql的 查询语言格式是这样的
select (一些条件语句)from (数据库的一些数据表) where (这里是条件)order by (这里就是排序了 有升序和降序 还有其他规定格式的排序)
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式