--- description: "GROUPING (Transact-SQL)" 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: 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: cawrites ms.author: chadam --- # GROUPING (Transact-SQL) [!INCLUDE [sql-asdb-asdbmi-asa-pdw](../../includes/applies-to-version/sql-asdb-asdbmi-asa.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 \