📄 group_by_years.asp
字号:
<!--#include file="conn.asp"-->
<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>在线考试系统 — 统计表</title>
<style>
<!--
td { font-size: 10pt }
-->
</style>
</head>
<body>
<table border="0" width="100%" height="30">
<tr>
<td width="100%" align="center"><b>考试成绩<%=request("str")%>统计表</b></td>
</tr>
<tr>
<td width="100%" align="center">
<p align="right">考试编号:<%=request("examid")%></td>
</tr>
</table>
<table border="1" width="100%" style="border-collapse: collapse;" cellpadding="2" cellspacing="0" bordercolor="#000000">
<tr>
<td width="20%" align="center"> </td>
<td width="20%" align="center"><b>人数</b></td>
</tr>
<%
sql="select count(*) as countper from view_score where examid='" & request("examid") & "' and years>=90 and years<=100"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,3,1
%>
<tr>
<td width="20%" align="center"><b>90-100岁 </b></td>
<td width="20%" align="center"><%=rs("countper")%> </td>
</tr>
<%
rs.close
%>
<%
sql="select count(*) as countper from view_score where examid='" & request("examid") & "' and years>=80 and years<90"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,3,1
%>
<tr>
<td width="20%" align="center"><b>80-90岁 </b></td>
<td width="20%" align="center"><%=rs("countper")%> </td>
</tr>
<%
rs.close
%>
<%
sql="select count(*) as countper from view_score where examid='" & request("examid") & "' and years>=70 and years<80"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,3,1
%>
<tr>
<td width="20%" align="center"><b>70-80岁 </b></td>
<td width="20%" align="center"><%=rs("countper")%> </td>
</tr>
<%
rs.close
%>
<%
sql="select count(*) as countper from view_score where examid='" & request("examid") & "' and years>=60 and years<70"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,3,1
%>
<tr>
<td width="20%" align="center"><b>60-70岁 </b></td>
<td width="20%" align="center"><%=rs("countper")%> </td>
</tr>
<%
rs.close
%>
<%
sql="select count(*) as countper from view_score where examid='" & request("examid") & "' and years>=50 and years<60"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,3,1
%>
<tr>
<td width="20%" align="center"><b>50-60岁 </b></td>
<td width="20%" align="center"><%=rs("countper")%> </td>
</tr>
<%
rs.close
%>
<%
sql="select count(*) as countper from view_score where examid='" & request("examid") & "' and years>=40 and years<50"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,3,1
%>
<tr>
<td width="20%" align="center"><b>40-50岁 </b></td>
<td width="20%" align="center"><%=rs("countper")%> </td>
</tr>
<%
rs.close
%>
<%
sql="select count(*) as countper from view_score where examid='" & request("examid") & "' and years>=30 and years<40"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,3,1
%>
<tr>
<td width="20%" align="center"><b>30-40岁 </b></td>
<td width="20%" align="center"><%=rs("countper")%> </td>
</tr>
<%
rs.close
%>
<%
sql="select count(*) as countper from view_score where examid='" & request("examid") & "' and years>=20 and years<30"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,3,1
%>
<tr>
<td width="20%" align="center"><b>20-30岁 </b></td>
<td width="20%" align="center"><%=rs("countper")%> </td>
</tr>
<%
rs.close
%>
<%
sql="select count(*) as countper from view_score where examid='" & request("examid") & "' and years>=10 and years<20"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,3,1
%>
<tr>
<td width="20%" align="center"><b>10-20岁 </b></td>
<td width="20%" align="center"><%=rs("countper")%> </td>
</tr>
<%
rs.close
%>
<%
sql="select count(*) as countper from view_score where examid='" & request("examid") & "' and years>=0 and years<0"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,3,1
%>
<tr>
<td width="20%" align="center"><b>0-10岁 </b></td>
<td width="20%" align="center"><%=rs("countper")%> </td>
</tr>
<%
rs.close
%>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -