你没说明白啊!你的表里也没有点击量的字段啊!怎么统计.
正常应该是这样的.
SELECT SUM(CUN) FROM BIAO WHERE id=? AND TIME<'2004-11-1' AND TIME>'2004-11-30' GROUP BY PAGE
正常应该是这样的.
SELECT SUM(CUN) FROM BIAO WHERE id=? AND TIME<'2004-11-1' AND TIME>'2004-11-30' GROUP BY PAGE
解决方案 »
- JAVA中的List问题
- 请教JPA的一个Unknown entity问题
- Fiddler无限发包
- java
- getHibernateTemplate如何执行聚合函数,或者count总的数据量
- 问个关于hibernate查询语句的问题~谢谢!
- 一个郁闷了我一个星期的问题,在线等,求高手解答,(解决就给分)
- 直接在jbuilder中运行MySessionFactory,为什么找不到/hibernate.cfg.xml
- 不明白??ctx.lookup("java:comp/env/ejb/StatelessDate");
- 连接不到远程数据库服务器
- struts怎么显示hibenate多表查询的内容
- JAVA之路
SELECT COUNT(id) FROM BIAO WHERE PAGE=? AND TIME < ? AND TIME> ?
我要通过 count 才能取道总数 ,而且要把 一年的数据 按照 每月的输出出来
14 10.0.0.50 1 2004-6-28 16:23:24
15 10.0.0.50 1 2004-6-28 16:24:56
16 10.0.0.50 1 2004-6-28 16:31:56
17 10.0.0.50 1 2004-6-28 16:35:56
18 10.0.0.50 1 2004-6-28 16:41:07
19 10.0.0.50 1 2004-6-28 16:51:47
20 10.0.0.50 1 2004-6-28 16:57:49
21 10.0.0.1 1 2004-6-28 17:02:09
22 10.0.0.16 1 2004-6-28 17:02:26
23 10.0.0.16 1 2004-7-28 这个市数据库里面的数据 要 输出成 六月 点击率 1000
七月 点击率 100这个样子
union all
SELECT COUNT(1),page FROM BIAO where page=? and time>=2004-2-1 and time<=2004-2-28
union all
SELECT COUNT(1),page FROM BIAO where page=? and time>=2004-3-1 and time<=2004-3-31
union all
SELECT COUNT(1),page FROM BIAO where page=? and time>=2004-4-1 and time<=2004-4-30
union all
SELECT COUNT(1),page FROM BIAO where page=? and time>=2004-5-1 and time<=2004-5-31
union all
SELECT COUNT(1),page FROM BIAO where page=? and time>=2004-6-1 and time<=2004-6-30
union all
SELECT COUNT(1),page FROM BIAO where page=? and time>=2004-7-1 and time<=2004-7-30
union all
SELECT COUNT(1),page FROM BIAO where page=? and time>=2004-8-1 and time<=2004-8-31
union all
SELECT COUNT(1),page FROM BIAO where page=? and time>=2004-9-1 and time<=2004-9-30
union all
SELECT COUNT(1),page FROM BIAO where page=? and time>=2004-10-1 and time<=2004-10-31
union all
SELECT COUNT(1),page FROM BIAO where page=? and time>=2004-11-1 and time<=2004-11-30
union all
SELECT COUNT(1),page FROM BIAO where page=? and time>=2004-12-1 and time<=2004-12-31
,COUNT(id)
from table
group by riqi
你试一下.