Decode Analytics

View Original

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.

See this content in the original post

Results:

See this content in the original post


Results:

See this content in the original post

SQL Tutorial

See this content in the original post