Returns a value that indicates whether a specified column in the result row was excluded from the grouping set of a GROUP BY clause.
IF the value of the specified column in the result row is … | THEN GROUPING returns … |
---|---|
a NULL generated when the extended grouping specification aggregated over the column and excluded it from the particular grouping | 1 |
anything else | 0 |