要做一个网站信息量分析,需要统计信息表里面各个栏目分类的信息数,然后按高到低排列。
<% set rs=server.CreateObject("adodb.recordset") rs.open "select * from (select [c_name],(select count(*) as total from [wq_news] where [wq_classc].c_name=[wq_news].c_name) as pl_num from [wq_classc]) order by [pl_num] desc",conn,1,1 do while not rs.eof %> <div> <%=rs("c_name")%> <% dim IdNum set rs1=conn.Execute("select count(*) from wq_news where c_name='"&rs("c_name")&"'") IdNum=rs1(0) if isnull(Id) then IdNum=0 if not rs1.eof then %> <%=IdNum%> <% end if rs1.close set rs1=nothing %> </div> <% rs.movenext loop rs.close set rs=nothing %>
建站咨询热线
029-33273980