--- title: "GROUPING (Transact-SQL) | Microsoft Docs" ms.custom: "" ms.date: "03/03/2017" ms.prod: "sql-non-specified" ms.reviewer: "" ms.suite: "" ms.technology: - "database-engine" ms.tgt_pltfrm: "" 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 caps.latest.revision: 32 author: "BYHAM" ms.author: "rickbyh" manager: "jhubbard" --- # GROUPING (Transact-SQL) [!INCLUDE[tsql-appliesto-ss2008-asdb-xxxx-xxx_md](../../includes/tsql-appliesto-ss2008-asdb-xxxx-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 \