Parameter | Type | Description |
---|---|---|
column | any | A column in a GROUP_BY clause. |
Returns: integer
Example
query:
SELECT sales_agent,
account,
GROUPING(sales_agent),
GROUPING(account),
SUM(order_value)
FROM apr_2017_orders
GROUP BY ROLLUP(sales_agent, account)
ORDER BY sales_agent, account
result: |sales_agent|account|grouping|grouping_2|sum| |-|-|-|-|-| |Boris Faz|Zencorporation|0|0|560| |Boris Faz|Zotware|0|0|59| |Boris Faz||0|1|18957| |Cassey Cress|Donquadtech|0|0|59| |Cassey Cress|Gekko & Co|0|0|1114| |Cassey Cress|Initech|0|0|3275|