GREATEST()

Overview

Returns the greatest argument from the argument list.

USAGE

GREATEST(value, value[, value] ...)

Argument Name

Description

value

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.

SYNONYMS

SCHEMA

PARAMETERS

SKYSQL

PRIVILEGES

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                       |
+-------------------------+

ERROR HANDLING

FEATURE INTERACTION

RESPONSES

DIAGNOSIS

ISO 9075:2016

CHANGE HISTORY

Release Series

History

23.09

  • Present starting in MariaDB Xpand 23.09.1.

6.1

  • Present starting in MariaDB Xpand 6.1.0.

6.0

  • Present starting in MariaDB Xpand 6.0.3.

5.3

  • Present starting in MariaDB Xpand 5.3.13.

Release Series

History

6.0

  • Present starting in MariaDB Xpand 6.0.3.

5.3

  • Present starting in MariaDB Xpand 5.3.13.

Release Series

History

6.1

  • Present starting in MariaDB Xpand 6.1.0.

EXTERNAL REFERENCES