partition outer join實現將稀疏數據轉為稠密數據,舉例:
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_sal from tt a left join t b partition by (b.deptno) on a.job = b.job
數據顯示結果:
按照所有deptno和job顯示出sal總值,沒有對應值顯示為空。
具體資料參考:
http://blog.sina.com.cn/s/blog_4cef5c7b01016lm5.html