按日做汇总啊:select trunc(datecol) 日期,sum(数量) 数量和,count(1) 数据量 from tablex where to_char(datecol,'yyyymm') = '201305' group by trunc(datecol);
select trunc(日期,'dd'),sum(数据量) from xxx group by trunc(日期,'dd');