辐射4 移除perk:用COUNT怎么统计

来源:百度文库 编辑:杭州交通信息网 时间:2024/04/30 11:38:32
sql里怎么用COUNT命令统计字段里的记录呢?比如说,A字段里等于5的所有数据一共有多少条,怎么统计呢?还有用ASP怎么显示在页面上呢!
还有没有更简单的解决办法呢,我的程序里要有好多这样的统计,几乎上百条了,每次统计都要这么长的代码不行吧?访问速度也会很慢的

算了,分多少有什么用呢?
sql="select count(*) as totalcount from table where a=5"
Set rs= Server.CreateObject("ADODB.Recordset")
rs.open sql,conn,1,3
if not rs.eof or rs.bof then
response.write(rs("totalcount"))
else
response.write("0")
end if

select count(字段) from 表 where 字段 = 5
asp不懂...

select count(*) from table where a=5;

再加多点分告诉你怎么显示在ASP里.

select count(*) from 表名 where A=5

asp 不会。sorry