You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Returns the query plan for a [!INCLUDE[ssDW](../../includes/ssdw-md.md)][!INCLUDE[DWsql](../../includes/dwsql-md.md)] statement without running the statement. Use EXPLAIN to preview which operations will require data movement and to view the estimated costs of the query operations. `WITH RECOMMENDATIONS` applies to Azure SQL Data Warehouse.
19
+
Returns the query plan for a [!INCLUDE[ssDW](../../includes/ssdw-md.md)][!INCLUDE[DWsql](../../includes/dwsql-md.md)] statement without running the statement. Use EXPLAIN to preview which operations will require data movement and to view the estimated costs of the query operations. `WITH RECOMMENDATIONS` applies to [!INCLUDE[ssSDW](../../includes/sssdwfull-md.md)].
20
20
21
21
## Syntax
22
22
@@ -37,7 +37,7 @@ Return the query plan with recommendations to optimize the SQL statement perform
37
37
38
38
## Permissions
39
39
40
-
Requires the **SHOWPLAN** permission, and permission to execute *SQL_statement*. See [Permissions: GRANT, DENY, REVOKE (Azure SQL Data Warehouse, Parallel Data Warehouse)](../../t-sql/statements/permissions-grant-deny-revoke-azure-sql-data-warehouse-parallel-data-warehouse.md).
40
+
Requires the **SHOWPLAN** permission, and permission to execute *SQL_statement*. See [Permissions: GRANT, DENY, REVOKE (Azure Synapse Analytics, Parallel Data Warehouse)](../../t-sql/statements/permissions-grant-deny-revoke-azure-sql-data-warehouse-parallel-data-warehouse.md).
41
41
42
42
## Return Value
43
43
@@ -615,6 +615,6 @@ FROM (SELECT CONVERT (INT, [T2_1].[col], 0) AS [col]
[SQL Data Warehouse and Parallel Data Warehouse Catalog Views](../../relational-databases/system-catalog-views/sql-data-warehouse-and-parallel-data-warehouse-catalog-views.md)
619
-
[System views supported in Azure SQL Data Warehouse](/azure/sql-data-warehouse/sql-data-warehouse-reference-tsql-system-views)
620
-
[T-SQL statements supported in Azure SQL Data Warehouse](/azure/sql-data-warehouse/sql-data-warehouse-reference-tsql-statements)
618
+
[Azure Synapse Analytics and Parallel Data Warehouse Catalog Views](../../relational-databases/system-catalog-views/sql-data-warehouse-and-parallel-data-warehouse-catalog-views.md)
619
+
[System views supported in Azure Synapse Analytics](/azure/sql-data-warehouse/sql-data-warehouse-reference-tsql-system-views)
620
+
[T-SQL statements supported in Azure Synapse Analytics](/azure/sql-data-warehouse/sql-data-warehouse-reference-tsql-statements)
Is a constant integer expression used by [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] to generate a random number. *repeat_seed* is **bigint**. If *repeat_seed* is not specified, [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] assigns a value at random. For a specific *repeat_seed* value, the sampling result is always the same if no changes have been applied to the table. The *repeat_seed* expression must evaluate to an integer greater than zero.
Specifies that a sample of data from the table is returned. The sample may be approximate. This clause can be used on any primary or joined table in a SELECT or UPDATE statement. TABLESAMPLE cannot be specified with views.
270
270
271
271
PERCENT
272
-
Specifies that a *sample_number* percent of the rows of the table should be retrieved from the table. When PERCENT is specified, SQL Data Warehouse returns an approximate of the percent specified. When PERCENT is specified, the *sample_number* expression must evaluate to a value from 0 to 100.
272
+
Specifies that a *sample_number* percent of the rows of the table should be retrieved from the table. When PERCENT is specified, [!INCLUDE[ssSDW](../../includes/sssdwfull-md.md)] returns an approximate of the percent specified. When PERCENT is specified, the *sample_number* expression must evaluate to a value from 0 to 100.
Data Manipulation Language (DML) is a vocabulary used to retrieve and work with data in [!INCLUDE[ssCurrent](../../includes/sscurrent-md.md)] and SQL Database. Most also work in SQL Data Warehouse and PDW (review each individual statement for details). Use these statements to add, modify, query, or remove data from a [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] database.
22
+
Data Manipulation Language (DML) is a vocabulary used to retrieve and work with data in [!INCLUDE[ssCurrent](../../includes/sscurrent-md.md)] and SQL Database. Most also work in [!INCLUDE[ssSDW](../../includes/sssdwfull-md.md)]and [!INCLUDE[ssPDW](../../includes/sspdw-md.md)] (review each individual statement for details). Use these statements to add, modify, query, or remove data from a [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] database.
23
23
24
24
## In This Section
25
25
The following table lists the DML statements that [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] uses.
Copy file name to clipboardExpand all lines: docs/t-sql/queries/select-group-by-transact-sql.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -80,7 +80,7 @@ GROUP BY
80
80
```
81
81
82
82
```syntaxsql
83
-
-- Syntax for Azure SQL Data Warehouse
83
+
-- Syntax for Azure Synapse Analytics
84
84
85
85
GROUP BY {
86
86
column-name [ WITH (DISTRIBUTED_AGG) ]
@@ -282,11 +282,11 @@ GROUP BY ALL:
282
282
- Will fail on columns that have the FILESTREAM attribute.
283
283
284
284
### WITH (DISTRIBUTED_AGG)
285
-
Applies to: Azure SQL Data Warehouse and Parallel Data Warehouse
285
+
Applies to: [!INCLUDE[ssSDW](../../includes/sssdwfull-md.md)]and [!INCLUDE[ssPDW](../../includes/sspdw-md.md)]
286
286
287
287
The DISTRIBUTED_AGG query hint forces the massively parallel processing (MPP) system to redistribute a table on a specific column before performing an aggregation. Only one column in the GROUP BY clause can have a DISTRIBUTED_AGG query hint. After the query finishes, the redistributed table is dropped. The original table is not changed.
288
288
289
-
NOTE: The DISTRIBUTED_AGG query hint is provided for backwards compatibility with earlier Parallel Data Warehouse versions and will not improve performance for most queries. By default, MPP already redistributes data as necessary to improve performance for aggregations.
289
+
NOTE: The DISTRIBUTED_AGG query hint is provided for backwards compatibility with earlier [!INCLUDE[ssPDW](../../includes/sspdw-md.md)] versions and will not improve performance for most queries. By default, MPP already redistributes data as necessary to improve performance for aggregations.
290
290
291
291
## General Remarks
292
292
@@ -309,7 +309,7 @@ NULL values:
309
309
310
310
## Limitations and Restrictions
311
311
312
-
Applies to: SQL Server (starting with 2008) and Azure SQL Data Warehouse
312
+
Applies to: SQL Server (starting with 2008) and [!INCLUDE[ssSDW](../../includes/sssdwfull-md.md)]
313
313
314
314
### Maximum capacity
315
315
@@ -410,7 +410,7 @@ HAVING DATEPART(yyyy,OrderDate) >= N'2003'
410
410
ORDER BY DATEPART(yyyy,OrderDate);
411
411
```
412
412
413
-
## Examples: SQL Data Warehouse and Parallel Data Warehouse
413
+
## Examples: Azure Synapse Analytics and Parallel Data Warehouse
414
414
415
415
### E. Basic use of the GROUP BY clause
416
416
The following example finds the total amount for all sales on each day. One row containing the sum of all sales is returned for each day.
0 commit comments