GREATEST
The GREATEST function returns the greatest value in a list of expressions. The return value is the same datatype as expr1.
Note: If the comparison is based on a character comparison, one character is considered greater than another if it has a higher character set value.
Syntax
GREATEST(arg1, arg2, arg3, ...)