August 2002
Intermediate to advanced
528 pages
10h 12m
English
A problem with the ROLLUP and CUBE options is the difficulty in identifying the rows that are subtotals. One way to identify subtotal rows is to identify the rows that contain null values. Expressions that are subtotaled will have a value in the column that determines the ROLLUP. The other expressions will contain null values. However, if the database contains nulls, this technique will not work because Oracle will also roll up null value records. Oracle developed the GROUPING function to help the identification of ROLLUP records.
GROUPING functions accept only one parameter. The GROUPING function returns a value of 1 if the row is a subtotal row for the target expression. The function will return a value of 0 if the row ...