Retrieve the price of the highest-priced product in the “Products” table.
| SELECT MAX(Price) AS LargestPrice FROM Products; |
The MAX() function retrieves the highest value from a set of values.
Note: Consider using the MIN() function for retrieving the lowest value.
| MAX(expression) |
|
Parameter |
Description |
|
expression |
Required: A numerical value, which can be either a field or a formula. |
|
Works in: |
SQL Server (beginning from 2008), Azure SQL Database, Azure SQL Data Warehouse, and Parallel Data Warehouse |