1、查询2013-01-01到2013-06-15时间段每天的数据量:
select trunc(datecol) 日期,count(*) 数量 from tablex where to_char(datecol,'yyyy-mm-dd') >= '2013-01-01' and to_char(datecol,'yyyy-mm-dd') < '2013-06-16' group by trunc(datecol);
2、求2013-01-01到2013-06-15时间段的数据量平均值:
select avg(数量) from (select trunc(datecol) 日期,count(*) 数量 from tablex where to_char(datecol,'yyyy-mm-dd') >= '2013-01-01' and to_char(datecol,'yyyy-mm-dd') < '2013-06-16' group by trunc(datecol));
文章转载自若能在一滴眼泪中闭关,如果涉嫌侵权,请发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。




