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进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。
评论
相关阅读
Oracle RAC 一键安装翻车?手把手教你如何排错!
Lucifer三思而后行
565次阅读
2025-04-15 17:24:06
【纯干货】Oracle 19C RU 19.27 发布,如何快速升级和安装?
Lucifer三思而后行
497次阅读
2025-04-18 14:18:38
Oracle SQL 执行计划分析与优化指南
Digital Observer
466次阅读
2025-04-01 11:08:44
XTTS跨版本迁移升级方案(11g to 19c RAC for Linux)
zwtian
458次阅读
2025-04-08 09:12:48
墨天轮个人数说知识点合集
JiekeXu
456次阅读
2025-04-01 15:56:03
【ORACLE】记录一些ORACLE的merge into语句的BUG
DarkAthena
443次阅读
2025-04-22 00:20:37
Oracle数据库一键巡检并生成HTML结果,免费脚本速来下载!
陈举超
434次阅读
2025-04-20 10:07:02
【ORACLE】你以为的真的是你以为的么?--ORA-38104: Columns referenced in the ON Clause cannot be updated
DarkAthena
419次阅读
2025-04-22 00:13:51
Oracle 19c RAC更换IP实战,运维必看!
szrsu
404次阅读
2025-04-08 23:57:08
【活动】分享你的压箱底干货文档,三篇解锁进阶奖励!
墨天轮编辑部
375次阅读
2025-04-17 17:02:24