ratio_to_report 分析函数求占比
来源:互联网 发布:win7网络加速器 编辑:程序博客网 时间:2024/04/29 15:05
drop table test; create table test ( name varchar(20), kemu varchar(20), score number ); insert into test values('testa','yuwen',10); insert into test values('testa','英语',100); insert into test values('testb','yuwen',60); insert into test values('testb','yuwen',120); insert into test values('testc','yuwen',40); select name, score, ratio_to_report(score) over() as "占所有科目的百分比", ratio_to_report(score) over(partition by kemu) as "占各科目的百分比" from test ;NAME SCORE 占所有科目的百分比 占各科目的百分比-------------------- ---------- ------------------ ----------------testa 10 .03030303 .043478261testb 60 .181818182 .260869565testc 40 .121212121 .173913043testb 120 .363636364 .52173913testa 100 .303030303 1drop table test;
试想下假设我们没有这个分析函数,实现就有可能如下:
select name,score, (score/sum(score) over()) as "占所有科目的百分比", (score/sum(score) over(partition by kemu)) as "占所有科目的百分比" from test group by name,score,kemu order by 2;
0 0
- ratio_to_report分析函数求占比
- ratio_to_report 分析函数求占比
- ratio_to_report分析函数求占比
- ratio_to_report分析函数求占比
- ratio_to_report分析函数求占比
- oracle ratio_to_report 占比函数
- oracle ratio_to_report 占比函数
- oracle 求占百分比的分析函数 ratio_to_report() over();
- Oracle SQL ratio_to_report函数、占比统计
- Oracle占比函数: oracle ratio_to_report
- oracle分析函数系列之ratio_to_report:计算占总数百分比
- ratio_to_report()分析函数
- 分析函数ratio_to_report的使用
- oracle分析函数Ratio_to_report使用说明
- 分析函数RATIO_TO_REPORT 的使用
- 分析函数ratio_to_report的使用
- oracle 求男女比例 sql 函数ratio_to_report
- 20090901_ 分析函数ratio_to_report的使用
- 第四章:Mac OS X内核故事之从PowerPC到Intel:
- qt 通过样式表修改背景
- SQLite3
- 第五章:Mac OS X内核故事之从32位到64位
- android graphic(3)—surfaceflinger的启动流程
- ratio_to_report 分析函数求占比
- 这行代码你敢试试吗
- Eclipse安装Freemarker Editor插件
- 16.php代理模式
- 为程序申请管理员权限
- linux下安装memcached服务
- 设置iframe的高度自适应,无滚动条
- mcbsp
- Android-利用LinearGradient实现文字一闪一闪