Skip to content

Commit a2f803e

Browse files
committed
Update to fix issue 5208
1 parent 60309f1 commit a2f803e

1 file changed

Lines changed: 18 additions & 8 deletions

File tree

docs/t-sql/queries/select-group-by-transact-sql.md

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
description: "SELECT - GROUP BY- Transact-SQL"
33
title: "GROUP BY (Transact-SQL) | Microsoft Docs"
44
ms.custom: ""
5-
ms.date: "03/01/2019"
5+
ms.date: "10/12/2021"
66
ms.prod: sql
77
ms.prod_service: "database-engine, sql-database, synapse-analytics, pdw"
88
ms.reviewer: ""
@@ -35,6 +35,7 @@ ms.author: mikeray
3535
monikerRange: ">=aps-pdw-2016||=azuresqldb-current||=azure-sqldw-latest||>=sql-server-2016||>=sql-server-linux-2017||=azuresqldb-mi-current"
3636
---
3737
# SELECT - GROUP BY- Transact-SQL
38+
3839
[!INCLUDE [sql-asdb-asdbmi-asa-pdw](../../includes/applies-to-version/sql-asdb-asdbmi-asa-pdw.md)]
3940

4041
A SELECT statement clause that divides the query result into groups of rows, usually for the purpose of performing one or more aggregations on each group. The SELECT statement returns one row per group.
@@ -73,9 +74,10 @@ GROUP BY {
7374
-- For backward compatibility only.
7475
-- Non-ISO-Compliant Syntax for SQL Server and Azure SQL Database
7576
76-
GROUP BY
77-
[ ALL ] column-expression [ ,...n ]
78-
| column-expression [ ,...n ] [ WITH { CUBE | ROLLUP } ]
77+
GROUP BY {
78+
ALL column-expression [ ,...n ]
79+
| column-expression [ ,...n ] WITH { CUBE | ROLLUP }
80+
}
7981
8082
```
8183

@@ -269,18 +271,26 @@ FROM Sales
269271
GROUP BY GROUPING SETS ( Country, () );
270272
```
271273

272-
### GROUP BY [ ALL ] column-expression [ ,...n ]
274+
### GROUP BY ALL column-expression [ ,...n ]
273275

274276
Applies to: SQL Server and Azure SQL Database
275277

276-
NOTE: This syntax is provided for backward compatibility only. It will be removed in a future version. Avoid using this syntax in new development work, and plan to modify applications that currently use this syntax.
278+
>[!NOTE]
279+
>This syntax is provided for backward compatibility only. It will be removed in a future version. Avoid using this syntax in new development work, and plan to modify applications that currently use this syntax.
277280
278-
Specifies to include all groups in the results regardless of whether they meet the search criteria in the WHERE clause. Groups that don't meet the search criteria have NULL for the aggregation.
281+
Specifies to include all groups in the results regardless of whether they meet the search criteria in the WHERE clause. Groups that don't meet the search criteria have NULL for the aggregation.
279282

280283
GROUP BY ALL:
281284
- Is not supported in queries that access remote tables if there is also a WHERE clause in the query.
282285
- Will fail on columns that have the FILESTREAM attribute.
283-
286+
287+
### GROUP BY column-expression [ ,...n ] WITH { CUBE | ROLLUP }
288+
289+
Applies to: SQL Server and Azure SQL Database
290+
291+
>[!NOTE]
292+
>This syntax is provided for backward compatibility only. Avoid using this syntax in new development work, and plan to modify applications that currently use this syntax.
293+
284294
### WITH (DISTRIBUTED_AGG)
285295
Applies to: [!INCLUDE[ssSDW](../../includes/sssdwfull-md.md)] and [!INCLUDE[ssPDW](../../includes/sspdw-md.md)]
286296

0 commit comments

Comments
 (0)