Custom Search

Saturday, August 23, 2008

SQL MAX Function

The MAX function returns the highest value in a column. NULL values are not included in the calculation.
Syntax

SELECT MAX(column) FROM table

Example

SELECT MAX(Age) FROM Persons

Result:

45

Note: The MIN and MAX functions can also be used on text columns, to find the highest or lowest value in alphabetical order.

No comments: