打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
oracle 按每天,每周,每月,每季度,每年查询统计数据


//按天统计

select count(dataid) as 每天操作数量, sum()

from tablename

group by trunc(createtime, 'DD'))

//按自然周统计
select to_char(date,'iw'),sum()
from  tablename
group by to_char(date,'iw')

//按自然月统计
select to_char(date,'mm'),sum()
from   tablename
group by to_char(date,'mm')

//按季统计
select to_char(date,'q'),sum()
from  tablename
group by to_char(date,'q')

//按年统计
select to_char(date,'yyyy'),sum()
from  tablename
group by to_char(date,'yyyy')

oracle 按每天,每周,每月,每季度,每年查询统计数据

来源本人博客:http://yijianfengvip.blog.163.com/blog/static/1752734322011112294145188/

本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
oracle 实现按天,周,月,季度,年查询统计数据
关于按周统计数据
Sum, Decode Reworking a Group By ? Oracle ...
浅谈Oracle中大数据量表的管理
Orcle-SQLServer区别小结
Oracle中char到Date和Number的转换
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服