oracle查询一个时间段每天的数据量

1.需求:
  从所有数据中,查出一个时间段中每天的数据量,即:按日做汇总。
2.SQL语句模板:   select trunc(date_col) date, sum(num_col) num, count(*) col_num   from table_name   where to_char(date_col,'yyyymm') = '201305'   group by trunc(date_col);

3.亲测有效√
posted @ 2016-10-18 15:05  xzluckydog  阅读(6415)  评论(0编辑  收藏  举报