--- title: "GROUPING (Transact-SQL) | Microsoft Docs" ms.custom: "" ms.date: "12/03/2019" ms.prod: sql ms.prod_service: "database-engine, sql-database" ms.reviewer: "" ms.technology: t-sql ms.topic: "language-reference" f1_keywords: - "GROUPING" - "GROUPING_TSQL" dev_langs: - "TSQL" helpviewer_keywords: - "null values [SQL Server], GROUPING function" - "grouping columns" - "ROLLUP operator" - "GROUP BY clause, GROUPING function" - "GROUPING function" - "CUBE operator" ms.assetid: 4efa3868-1fc4-4626-8fb1-e863cc03e422 author: MikeRayMSFT ms.author: mikeray --- # GROUPING (Transact-SQL) [!INCLUDE[tsql-appliesto-ss2008-asdb-asdw-xxx-md](../../includes/tsql-appliesto-ss2008-asdb-asdw-xxx-md.md)] Indicates whether a specified column expression in a GROUP BY list is aggregated or not. GROUPING returns 1 for aggregated or 0 for not aggregated in the result set. GROUPING can be used only in the SELECT \