Posts

Showing posts with the label GROUPING

OLAP features in Oracle|ROLLUP| CUBE| GROUPING| GROUP ID| RANK| NULLs|DECODE

    CHAPTER 7-OLAP features in oracle à OLAP (Online analytical processing) à OLAP provides extra features to queries up on database. à The OLAP operations are perform enhancements like top n query, group (), cube, ROLLUP… ROLLUP à It is used with group by clause to display summarized data. à ROLLUP grouping produces subtotals and grand total. à Select deptno, sum (sal) from emp group by ROLLUP (deptno); Select job, sum (sal) from emp group by ROLLUP (job); à Passing multiple columns to ROLLUP Select deptno, job, sum (sal) from emp group by ROLLUP (deptno, job); 1 st it groups into deptno wise and then calculate totals of job wise in that deptno. CUBE à The result of a cube in a summery that stores subtotals of every combination of column or expression. à It is similar to ROLLUP but extension of ROLLUP. à Select deptno, job, sum (sal) from emp group by CUBE (deptno, job); It 1 st display grand total, job wise sub totals and then dept...