MAX Function in SQL

Level 243 keystrokes

MAX function returns the largest value in a column.

SQL code

1SELECT
-- MAX returns the largest price value; NULL values are ignored
-- AS highest names the result column
2 MAX(price) AS highest
3FROM
4 products;

Output

+---------+
| highest |
+---------+
|   99.99 |
+---------+
1 row in set
Practice typing this code

Practice typing this code. Results are not recorded in the rankings.

Symbols in this code

The symbols you type in this SQL code and how often they appear.

  • ;× 1
  • (× 1
  • )× 1

More SQL examples at level 2

← SQL typing practice