里面有个字段“chengji”
因为我想把没一行的的成绩(chengji)相加,再除总共的行数,其实是求平均数。我知道会用到SUM()和CUONT()
不过具体怎样用啊~~~
请高手指出!
多谢帮帮!
也可发我的邮箱
YUSAI@56.COM
<HTML><HEAD>
<title>saisai</title>
<!--#include file="top.htm" -->
<!--#include file="conn.asp" -->
<style type="text/css">
<!--
@import url("sai.css");
body {
margin-top: 0px;
}
.style1 {font-weight: bold}
-->
</style>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"></HEAD>
<BODY>
<table width="700" border="0" align="center">
<tr>
<td><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="752" height="1"><div align="center"></div></td>
</tr>
</table>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="1">
<tr bgcolor="#A0A4AC">
<td width="96" height="25"> 姓名</td>
<td width="91">学号</td>
<td width="39">英语</td>
<td width="48">ASP</td>
<td width="77">ASP.NET</td>
<td width="93">EDI技术</td>
<td width="120">电子商务</td>
<td width="101">VB.NET编程</td>
<td width="77">平均基点</td>
</tr>
</table>
<div align="center">
<%
sql="select * from student order by pjjd DESC "
rs.open sql,conn,1,1 if rs.EOF or rs.BOF then
Response.Write "数据库中暂无资料!"
else
do while not rs.EOF or rs.BOF
%>
</div>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="1">
<tr bgcolor="#A0A4AC">
<td width="93" height="25"><%=rs("name")%></td>
<!-- 用户名 -->
<td width="83"><%=rs("xh")%></td>
<td width="48"><%=rs("en")%></td>
<td width="80"><%=rs("net")%></td>
<td width="93"><%=rs("edi")%></td>
<td width="119"><%=rs("eb")%></td>
<td width="103"><%=rs("vb")%></td>
<td width="75"><%=FormatNumber (rs("pjjd"),3)%></td>
<!--备份 -->
</tr>
</table>
<%
rs.movenext
loop
end if
set rs=nothing
set conn=nothing
%>
<table width="751" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="751" height="1"><div align="left">全班的平均成绩:
<%
sql="select sum(chengji),count(chengji) from student"
rs.open sql,conn,1,1
av=rs(0)/rs(1)
%>
</div></td>
</tr>
</table>
</td>
</tr>
</table>
<!--#include file="BT.htm" -->
</BODY>
</HTML>
[此贴子已经被作者于2005-11-28 15:16:54编辑过]
[此贴子已经被作者于2005-11-28 15:22:01编辑过]
还是不行啊`~~~~
http://www.jz173.net/dispbbs.aspx?board_id=20&id=208183
这有点提示,我还是搞不到。