欢迎投稿

今日深度:

Oracle Partition Outer Join 稠化报表

Oracle Partition Outer Join 稠化报表


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总值,没有对应值显示为空。

www.htsjk.Com true http://www.htsjk.com/oracle/23759.html NewsArticle Oracle Partition Outer Join 稠化报表 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,...
评论暂时关闭