The GROUPING function returns 1 if the column value in a row is a NULL generated by a ROLLUP or CUBE operation (representing a subtotal/total group), and 0 otherwise. It can only be used with ROLLUP/CUBE in the GROUP BY clause. It does not identify standard stored NULL values.