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.亲测有效√
本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。