Declaration
LEAST(value1, ...)
Description
Return the minimum value of the parameters, which is the opposite of the GREATEST() function.
The number of parameters must be at least two. If any parameter is NULL, the return value is NULL.
When both numeric and character values are present in a parameter, the characters are implicitly converted to the numeric type. If conversion is not possible, an error is reported.
Examples
obclient> SELECT LEAST(2, null), LEAST('2',4,9), LEAST('a','b','c'), LEAST('a',NULL,'c'), LEAST('2014-05-15','2014-06-01')\G
*************************** 1. row ***************************
LEAST(2, null): NULL
LEAST('2',4,9): 2
LEAST('a','b','c'): a
LEAST('a',NULL,'c'): NULL
LEAST('2014-05-15','2014-06-01'): 2014-05-15
1 row in set
obclient> SELECT LEAST(2);
ERROR 1582 (42000): Incorrect parameter count in the call to native function 'LEAST'