Documentation IndexFetch the complete documentation index at: /llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
grouping_id 用于区分相同分组标准的分组统计结果。
GROUPING_ID(expr)
epxr
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 | +------+------------+