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

数据显示结果:

 

Oracle Partition Outer Join 稠化报表

按照所有deptno和job显示出sal总值,没有对应值显示为空。

具体资料参考:

http://blog.sina.com.cn/s/blog_4cef5c7b01016lm5.html

相关文章:

  • 2021-12-25
  • 2021-05-06
  • 2021-04-28
  • 2022-02-05
  • 2021-09-13
  • 2021-11-08
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-07-02
  • 2021-04-19
  • 2022-12-23
  • 2021-09-19
  • 2021-12-31
相关资源
相似解决方案