SQL Server MAX() Function
Example
Find the price of the most expensive product in the "Products" table:
SELECT MAX(Price) AS LargestPrice FROM Products;
Try it Yourself »
Definition and Usage
The MAX() function returns the maximum value of an expression.
Note: See also the MIN() function.
Syntax
MAX(expression)
Parameter Values
Parameter | Description |
---|---|
expression | Required. A numeric value (can be a field or a formula) |
Technical Details
Works in: | SQL Server 2014, SQL Server 2012, SQL Server 2008 R2, SQL Server 2008, SQL Server 2005 |
---|