GREATEST()
This page is part of MariaDB's Documentation.
The parent of this page is: Functions for MariaDB Xpand
Topics on this page:
Overview
Returns the greatest argument from the argument list.
USAGE
GREATEST(value, value[, value] ...)
Argument Name | Description |
---|---|
| The values to compare |
DETAILS
GREATEST()
is a comparison function that returns the argument with the greatest value from among the two or more arguments.
A NULL
is returned if any of the arguments is NULL
.
EXAMPLES
SELECT GREATEST(1, 0, 42, 5);
+-----------------------+
| GREATEST(1, 0, 42, 5) |
+-----------------------+
| 42 |
+-----------------------+
SELECT GREATEST(-0.5, -0.8);
+----------------------+
| GREATEST(-0.5, -0.8) |
+----------------------+
| -0.5 |
+----------------------+
SELECT GREATEST('C', 'c', 'A');
+-------------------------+
| GREATEST('C', 'c', 'A') |
+-------------------------+
| C |
+-------------------------+