Grouping functions

SQL Function Description

GROUP_ID()

Returns an integer that uniquely identifies the combination of grouping keys.

GROUPING(expression1 [, expression2]* )

GROUPING_ID(expression1 [, expression2]* )

Returns a bit vector of the given grouping expressions.