GROUPING Function [Aggregate]

Identifies whether a column in a ROLLUP or CUBE operation result set is NULL because it is part of a subtotal row, or NULL because of the underlying data.

Syntax

GROUPINGgroup-by-expression ) 

Parameters

Parameter

Description

group-by-expression

An expression appearing as a grouping column in the result set of a query that uses a GROUP BY clause with the ROLLUP or CUBE keyword. The function identifies subtotal rows added to the result set by a ROLLUP or CUBE operation.

Currently, SAP Sybase IQ does not support the PERCENTILE_CONT or PERCENTILE_DISC functions with GROUP BY CUBE operations.

Returns

Value

Description

1

Indicates that group-by-expression is NULL because it is part of a subtotal row. The column is not a prefix column for that row.

0

Indicates that group-by-expression is a prefix column of a subtotal row.

Standards and Compatibility

  • SQL—Vendor extension to ISO/ANSI SQL grammar.

  • Sybase—Not supported by Adaptive Server Enterprise.

Related concepts
Windowing Aggregate Function Usage