wifi模块传输距离:access 数据库 求sql统计查询语句

来源:百度文库 编辑:高考问答 时间:2024/04/29 07:29:22
Id 姓名 完成工作数量 时间
1 a 1 2006-6-1
2 b 2 2006-6-1
3 c 3 2006-6-1
4 a 2 2006-6-2
5 b 3 2006-6-2
6 d 2 2006-6-2
7 a 1 2006-6-3
8 b 2 2006-6-3
9 e 3 2006-6-4

查询结果
a-----------------4
b-----------------7
c-----------------3
d-----------------2
e-----------------3

access 数据库 求sql统计查询语句

select 姓名,sum(完成工作数量)
from 表名
group by 姓名

<%
dim connstr,mysql,myconn
connstr="provider=microsoft.jet.oledb.4.0;data source="& server.mappath("ysk.mdb")
set myconn=server.createobject("adodb.connection")
myconn.connectionstring=connstr
myconn.open

mysql="select sum(完成工作数量) as aaaa from 表名 where 姓名='a'"
set myres=myconn.execute(mysql)
do while not myres.eof
%>
<%=myres("aaaa")%><br>
<%
myres.movenext
loop
%>

测试通过