Oracle Cube | Cube - oracle tutorial - sql tutorial
What is Oracle CUBE ?
- In addition to the subtotals generated by the ROLLUP extension, the CUBE extension will generate subtotals for all combinations of the dimensions specified.
oracle tutorial , sql tutorial , sql , pl sql tutorial , oracle , pl sql , plsql
Syntax:
Example:
Sample Database:
- For better understanding of cube concept we are using a Wikitechy_employee table.
Code Explanation:
- The select list contains the dimension columns and aggregate function expressions selected from wikitechy_employee table.
- The CUBE operator is specified in the GROUP BY clause of a SELECT statement.
- The GROUP BY specifies the dimension columns and the keywords WITH CUBE.
Oracle cubes-data-warehousing-data-mart
Cube Example Output:
- This row report the subtotal for the City dimension. It have null in the ID dimension to show that the aggregate data came from row having any value for the ID dimension.
- This row depicts the total value of each city.