MAX() and MIN() Functions in SQL Server

MAX() and MIN() Functions in SQL Server

The MAX() function returns the largest value of the selected column and MIN() function returns the smallest value of the selected column.

MAX() Syntax

SELECT MAX(column_name)
FROM table_name
WHERE condition

MIN() Syntax

SELECT MIN(column_name)
FROM table_name
WHERE condition

SQL statement finds the price of the lowest product

SELECT MIN(Price) AS Price
FROM Order

SQL statement finds the price of the most Heighest product

SELECT MAX(Price) AS Price
FROM Order

2020-03-28