dnf魔能石能换什么宝珠:asp问题??

来源:百度文库 编辑:杭州交通信息网 时间:2024/05/08 09:03:48
我的数据库每天都要添加内容(人数)不止1条记录,有时一天要添加好几条记录,我想统计每个月的人数,
SQL语句怎么写?

想问一下,一条记录表示一个人得日志,还是一个人数(可能大于1)???

(1)一个日志:
select count(*) from tablename where data1 between time1 to time2

(2) 一条记录为一个数字:

select sum(renshu) from tablename where data1 between time1 to time2

注:如果为access ,日期用“#”括起来,如果市sql server ,用单引号

select count(renshu) from 表 where dtm between 时间1 to 时间2