本帖最后由 omar14 于 2011-04-19 23:12:24 编辑

解决方案 »

  1.   

    <%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%>
      

  2.   

    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
    从数据集(上面那条语句生成的数据集)的第一条循环到最后一条.
      

  3.   

    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条数据
      

  4.   

    就是在网页上循环显示SQL语句查询出来的列表
    <br>就是换行
      

  5.   

    数据库没有rs_tiaoshu2  的字段啊