日期:2014-05-17 浏览次数:20789 次
id date number
1 2012-07-12 17:05:15 10
2 2012-07-12 18:12:15 12
3 2012-07-12 19:17:15 10
4 2012-07-12 20:26:15 19
5 2012-07-13 17:05:15 5
6 2012-07-13 18:05:15 12
7 2012-07-13 19:26:15 18
8 2012-07-13 20:29:15 23
9 2012-07-13 21:33:15 15
select sum(number) from t where to_number(to_char(date,'yyyymmhh24')) between 20120718 and 20120720
select sum(number) from 表名 where to_char(date,'yyyy-mm')='2012-07' and
to_char(date,'hh24')>=18 and to_char(date,'hh24')<=20