<%sql="SELECT top 20 suozaidanwei,sum(rs_tiaoshu) as rs_tiaoshu2 FROM gat56t where isinrecycle='0' GROUP BY suozaidanwei order by rs_tiaoshu2 desc" sql 语句赋值 set rs=server.CreateObject("adodb.recordset") 定义数据集 rs.open sql,conn,1,2 连接数据库 赋值到数据集 %> <% do while not rs.eof%> 如果不为空 循环 <br> <%=rs("suozaidanwei")%><span class="STYLE1"><%=rs("rs_tiaoshu2")%>条</span><br> <%赋值 rs.movenext loop%>
SELECT top 20 suozaidanwei,sum(rs_tiaoshu) as rs_tiaoshu2 FROM gat56t where isinrecycle='0' GROUP BY suozaidanwei order by rs_tiaoshu2 desc按照条件和排序查询前20条数据.do while not rs.eof 从数据集(上面那条语句生成的数据集)的第一条循环到最后一条.
SELECT top 20 suozaidanwei,sum(rs_tiaoshu) as rs_tiaoshu2 FROM gat56t where isinrecycle='0' 这句话的意思是查询出20行数据 字段分别为suozaidanwei,rs_tiaoshu2 do while not rs.eof%> 如果不为空 循环 <br> <%=rs("suozaidanwei")%><span class="STYLE1"><%=rs("rs_tiaoshu2")%>条</span><br> <%赋值 rs.movenext这句话是用循环显示出来这20条数据
sql 语句赋值
set rs=server.CreateObject("adodb.recordset") 定义数据集
rs.open sql,conn,1,2 连接数据库 赋值到数据集
%>
<%
do while not rs.eof%> 如果不为空 循环
<br>
<%=rs("suozaidanwei")%><span class="STYLE1"><%=rs("rs_tiaoshu2")%>条</span><br>
<%赋值
rs.movenext
loop%>
从数据集(上面那条语句生成的数据集)的第一条循环到最后一条.
这句话的意思是查询出20行数据 字段分别为suozaidanwei,rs_tiaoshu2 do while not rs.eof%> 如果不为空 循环
<br>
<%=rs("suozaidanwei")%><span class="STYLE1"><%=rs("rs_tiaoshu2")%>条</span><br>
<%赋值
rs.movenext这句话是用循环显示出来这20条数据
<br>就是换行