oracle统计
来源:互联网 发布:南财网络教育平台 编辑:程序博客网 时间:2024/05/29 12:16
- -----按天统计
- select to_char(t.hiredate, 'yyyy/mm/dd') 日期, count(1) 数量
- from EMP t
- where t.hiredate >= to_date('1980/1/1', 'yyyy/mm/dd')
- and t.hiredate <= to_date('2017/1/31', 'yyyy/mm/dd')
- group by to_char(t.hiredate, 'yyyy/mm/dd')
- order by 日期;
- ---按月统计
- select to_char(t.hiredate, 'yyyy/mm') 日期, count(1) 数量
- from EMP t
- where t.hiredate >= to_date('1980/1/1', 'yyyy/mm/dd')
- and t.hiredate <= to_date('2017/12/31', 'yyyy/mm/dd')
- group by to_char(t.hiredate, 'yyyy/mm')
- order by 日期;
- -----按年统计
- select to_char(t.hiredate, 'yyyy') 日期, count(1) 数量
- from EMP t
- where t.hiredate >= to_date('1980/1/1', 'yyyy/mm/dd')
- and t.hiredate <= to_date('2017/12/31', 'yyyy/mm/dd')
- group by to_char(t.hiredate, 'yyyy')
- order by 日期;
- -----按季度统计
- select to_char(t.hiredate, 'q') 日期, count(1) 数量
- from EMP t
- where t.hiredate >= to_date('1980/1/1', 'yyyy/mm/dd')
- and t.hiredate <= to_date('2017/12/31', 'yyyy/mm/dd')
- group by to_char(t.hiredate, 'q')
- order by 日期;
- -----按周统计
- select to_char(t.hiredate, 'iw') 日期, count(1) 数量
- from EMP t
- where t.hiredate >= to_date('1980/1/1', 'yyyy/mm/dd')
- and t.hiredate <= to_date('2017/12/31', 'yyyy/mm/dd')
- group by to_char(t.hiredate, 'iw')
- order by 日期;
阅读全文
0 0
- oracle 统计
- oracle统计
- oracle表统计
- oracle索引统计
- oracle分组统计
- oracle统计函数
- oracle间隔时间段统计
- oracle sql 分组统计
- oracle统计信息收集
- oracle分组统计sql
- oracle统计信息收集
- oracle 统计信息是什么
- oracle 逗号分割 统计
- ORACLE统计信息
- oracle中的数据统计
- 收集oracle统计信息
- 收集oracle统计信息
- ORACLE 统计分组语句
- hdoj 4745 Two Rabbits
- springMVC 返回类型选择 以及 SpringMVC中model,modelMap.request,session取值顺序
- PHP简单对称加密
- Hibernate(三)---通过Session操纵持久化对象
- 内存地址问题总结
- oracle统计
- unity InputFied.onValuechanged 应用
- JS监听手机返回键
- c语言基础(一)
- python实现二分搜索树以及改进后的AVL Tree
- hdoj 1013 Digital roots (陷阱水题)
- 数据样本不平衡问题处理方法
- cc1plus.exe: out of memory allocating 3077145919 bytes
- js拼装html无法触发事件