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
Copy file name to clipboardExpand all lines: docs/sql-server/azure-arc/release-notes.md
-3Lines changed: 0 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -87,9 +87,6 @@ The following features are now generally available (GA):
87
87
-[Client connection summary](sql-connection-summary.md): You can view a summary of all client connections to your SQL Server instances in the Azure portal.
88
88
-[Database migration](migrate-to-azure-sql-managed-instance.md): Migrate your SQL Server databases to Azure SQL Managed Instance directly from the Azure portal.
89
89
90
-
Certain limitations in [US Government Virginia](us-government-region.md) are lifted. You can now onboard environments with:
Copy file name to clipboardExpand all lines: docs/sql-server/azure-arc/us-government-region.md
+4-1Lines changed: 4 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -51,10 +51,13 @@ Currently, in the US Government Virginia region, SQL Server registration provide
51
51
-[Subscribe to Extended Security Updates in a production environment](extended-security-updates.md#subscribe-to-extended-security-updates-in-a-production-environment).
52
52
-[Manage licensing and billing of SQL Server enabled by Azure Arc](manage-license-billing.md).
53
53
- License virtual cores.
54
-
-[Managing Always On availability groups](manage-availability-group.md).
55
54
56
55
[All other features](overview.md#feature-differentiation) aren't currently available.
57
56
57
+
## Limitations
58
+
59
+
- Onboarding failover cluster instances isn't currently supported.
MAX ([ ALL ] expression) OVER ( <partition_by_clause> [ <order_by_clause> ] )
36
-
```
37
-
26
+
Returns the maximum of all values of the specified expression in a group. Can be followed by the [OVER](../queries/select-over-clause-transact-sql.md) clause.
27
+
28
+
> [!NOTE]
29
+
> To get the maximum of all values of multiple expressions inline, see [Logical functions - GREATEST](logical-functions-greatest-transact-sql.md).
MAX ( [ ALL ] expression) OVER ( [ <partition_by_clause> ] [ <order_by_clause> ] )
45
+
```
46
+
38
47
## Arguments
39
-
**ALL**
40
-
Applies the aggregate function to all values. ALL is the default.
41
-
42
-
DISTINCT
43
-
Specifies that each unique value is considered. DISTINCT is not meaningful with MAX and is available for ISO compatibility only.
44
-
45
-
*expression*
46
-
Is a constant, column name, or function, and any combination of arithmetic, bitwise, and string operators. MAX can be used with **numeric**, **character**, **uniqueidentifier**, and **datetime** columns, but not with **bit** columns. Aggregate functions and subqueries are not permitted.
47
-
48
-
For more information, see [Expressions (Transact-SQL)](../../t-sql/language-elements/expressions-transact-sql.md).
49
-
50
-
OVER **(**_partition\_by\_clause_[_order\_by\_clause_]**)**
51
-
*partition_by_clause* divides the result set produced by the FROM clause into partitions to which the function is applied. If not specified, the function treats all rows of the query result set as a single group. *order_by_clause* determines the logical order in which the operation is performed. *_partition\_by\_clause_* is required. For more information, see [OVER Clause (Transact-SQL)](../../t-sql/queries/select-over-clause-transact-sql.md).
52
-
53
-
## Return Types
54
-
Returns a value same as *expression*.
55
-
56
-
## Remarks
57
-
MAX ignores any null values.
58
-
59
-
MAX returns NULL when there is no row to select.
60
-
61
-
For character columns, MAX finds the highest value in the collating sequence.
62
-
63
-
MAX is a deterministic function when used without the OVER and ORDER BY clauses. It is nondeterministic when specified with the OVER and ORDER BY clauses. For more information, see [Deterministic and Nondeterministic Functions](../../relational-databases/user-defined-functions/deterministic-and-nondeterministic-functions.md).
64
-
65
-
## Examples
66
-
67
-
### A. Simple example
68
-
The following example returns the highest (maximum) tax rate in the [!INCLUDE[ssSampleDBnormal](../../includes/sssampledbnormal-md.md)] database.
The following example uses the MIN, MAX, AVG, and COUNT functions with the OVER clause to provide aggregated values for each department in the `HumanResources.Department` table in the [!INCLUDE[ssSampleDBnormal](../../includes/sssampledbnormal-md.md)] database.
88
-
89
-
```sql
90
-
SELECT DISTINCT Name
91
-
, MIN(Rate) OVER (PARTITION BY edh.DepartmentID) AS MinSalary
92
-
, MAX(Rate) OVER (PARTITION BY edh.DepartmentID) AS MaxSalary
93
-
, AVG(Rate) OVER (PARTITION BY edh.DepartmentID) AS AvgSalary
94
-
,COUNT(edh.BusinessEntityID) OVER (PARTITION BY edh.DepartmentID) AS EmployeesPerDept
Research and Development 40.8654 50.4808 43.6731 4
122
-
Sales 23.0769 72.1154 29.9719 18
123
-
Shipping and Receiving 9.00 19.2308 10.8718 6
124
-
Tool Design 8.62 29.8462 23.5054 6
125
-
126
-
(16 row(s) affected)
127
-
```
128
-
129
-
### C. Using MAX with character data
130
-
The following example returns the database name that sorts as the last name alphabetically. The example uses `WHERE database_id < 5`, to consider only the system databases.
Applies the aggregate function to all values. `ALL` is the default.
52
+
53
+
#### DISTINCT
54
+
55
+
Specifies that each unique value is considered. `DISTINCT` isn't meaningful with `MAX`, and is available for ISO compatibility only.
56
+
57
+
#### *expression*
58
+
59
+
A constant, column name, or function, and any combination of arithmetic, bitwise, and string operators. `MAX` can be used with **numeric**, **char**, **nchar**, **varchar**, **nvarchar**, **uniqueidentifier**, or **datetime** columns, but not with **bit** columns. Aggregate functions and subqueries aren't permitted.
60
+
61
+
For more information, see [Expressions](../language-elements/expressions-transact-sql.md).
62
+
63
+
#### OVER ( [*partition_by_clause*][*order_by_clause*] )
64
+
65
+
*partition_by_clause* divides the result set produced by the `FROM` clause into partitions to which the function is applied. If not specified, the function treats all rows of the query result set as a single group.
66
+
67
+
*order_by_clause* determines the logical order in which the operation is performed.
68
+
69
+
For more information, see [SELECT - OVER clause](../queries/select-over-clause-transact-sql.md).
70
+
71
+
## Return types
72
+
73
+
Returns a value same as *expression*.
74
+
75
+
## Remarks
76
+
77
+
`MAX` ignores any null values.
78
+
79
+
`MAX` returns `NULL` when there's no row to select.
80
+
81
+
For character columns, `MAX` finds the highest value in the collating sequence.
82
+
83
+
`MAX` is a deterministic function when used without the `OVER` and `ORDER BY` clauses. It's nondeterministic when specified with the `OVER` and `ORDER BY` clauses. For more information, see [Deterministic and nondeterministic functions](../../relational-databases/user-defined-functions/deterministic-and-nondeterministic-functions.md).
84
+
85
+
`MAX` operates on a set of rows. To obtain the maximum value for a set of values inline, see [Logical functions - GREATEST](logical-functions-greatest-transact-sql.md).
The following example uses the `MIN`, `MAX`, `AVG`, and `COUNT` functions with the `OVER` clause to provide aggregated values for each department in the `HumanResources.Department` table.
112
+
113
+
```sql
114
+
SELECT DISTINCT Name,
115
+
MIN(Rate) OVER (PARTITION BY edh.DepartmentID) AS MinSalary,
116
+
MAX(Rate) OVER (PARTITION BY edh.DepartmentID) AS MaxSalary,
117
+
AVG(Rate) OVER (PARTITION BY edh.DepartmentID) AS AvgSalary,
118
+
COUNT(edh.BusinessEntityID) OVER (PARTITION BY edh.DepartmentID) AS EmployeesPerDept
Research and Development 40.8654 50.4808 43.6731 4
146
+
Sales 23.0769 72.1154 29.9719 18
147
+
Shipping and Receiving 9.00 19.2308 10.8718 6
148
+
Tool Design 8.62 29.8462 23.5054 6
149
+
```
150
+
151
+
### C. Use MAX with character data
152
+
153
+
The following example returns the database name that sorts using the database name alphabetically. The example uses `WHERE database_id < 5`, to select the system databases.
0 commit comments