GREATEST(value1,value2,...)
With two or more arguments, returns the largest (maximum-valued) argument. The arguments are compared using the same rules as for LEAST().
SELECT GREATEST(2,0); +---------------+ | GREATEST(2,0) | +---------------+ | 2 | +---------------+
SELECT GREATEST(34.0,3.0,5.0,767.0); +------------------------------+ | GREATEST(34.0,3.0,5.0,767.0) | +------------------------------+ | 767.0 | +------------------------------+
SELECT GREATEST('B','A','C'); +-----------------------+ | GREATEST('B','A','C') | +-----------------------+ | C | +-----------------------+
© 2019 MariaDB
Licensed under the Creative Commons Attribution 3.0 Unported License and the GNU Free Documentation License.
https://mariadb.com/kb/en/greatest/