Oracle Partition Outer Join 稠化报表
生活随笔
收集整理的這篇文章主要介紹了
Oracle Partition Outer Join 稠化报表
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
partition outer join實(shí)現(xiàn)將稀疏數(shù)據(jù)轉(zhuǎn)為稠密數(shù)據(jù),舉例:
with t as(select deptno, job, sum(sal) sum_sal from emp group by deptno, job), tt as(select distinct job from t) select b.deptno, a.job, sum_salfrom tt aleft join t b partition by (b.deptno)on a.job = b.job數(shù)據(jù)顯示結(jié)果:
?
按照所有deptno和job顯示出sal總值,沒有對應(yīng)值顯示為空。
具體資料參考:
http://blog.sina.com.cn/s/blog_4cef5c7b01016lm5.html
轉(zhuǎn)載于:https://www.cnblogs.com/mellowsmile/p/4863561.html
總結(jié)
以上是生活随笔為你收集整理的Oracle Partition Outer Join 稠化报表的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: C实战:项目构建Make,Automak
- 下一篇: 解决.gitgnore加入.idea无效