Select MIN MAX
The MIN() function returns the smallest value of the column.
The MAX() function returns the largest value of the column.
SQL Select MIN() Syntax:
SELECT MIN(Column1)
FROM Table_Name
WHERE condition;
SQL Select MAX() Syntax:
SELECT MAX(Column1)
FROM Table_Name
WHERE condition;
Example:
Lets select the MIN and MAX OrderID from the Orders table.
Results:
Results:
SQL Tutorial