Syntax
LEAST(value1, ...)
Purpose
Returns the minimum value of the parameters, which is the opposite of the GREATEST() function.
At least two parameters are required. If any parameter is NULL, the return value is NULL.
When both numeric and character parameters are provided, the character parameters are implicitly converted to numeric types. If the conversion fails, an error is returned.
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'
