The SQL MAX aggregate function is used to determine the largest values respectively in a column..
The SQL MAX syntax is looks like this:
SELECT MAX ( [COLUMN NAME] ) FROM [TABLE NAME]
EXAMPLE :
We can see with a simple example which is return largest value of the scores in the table.
Table GameScores
PlayerName | Department | Scores |
Jason | IT | 3000 |
Irene | IT | 1500 |
Jane | Marketing | 1000 |
David | Marketing | 2500 |
Paul | HR | 2000 |
James | HR | 2000 |
SQL statement :
SELECT MAX(Scores) FROM GameScores
Result:
MAX(Scores) |
3000 |