> ## Documentation Index
> Fetch the complete documentation index at: /documents/llms.txt
> Use this file to discover all available pages before exploring further.

# grouping_id

> grouping_id is used to distinguish the grouping statistics results of the same grouping standard.

grouping\_id is used to distinguish the grouping statistics results of the same grouping standard.

## Syntax

```Haskell theme={null}
GROUPING_ID(expr)
```

## Examples

```Plain theme={null}
MySQL > SELECT COL1,GROUPING_ID(COL2) AS 'GroupingID' FROM tbl GROUP BY ROLLUP (COL1, COL2);
+------+------------+
| COL1 | GroupingID |
+------+------------+
| NULL |          1 |
| 2.20 |          1 |
| 2.20 |          0 |
| 1.10 |          1 |
| 1.10 |          0 |
+------+------------+
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.