Syntax
LEAST(value1, ...)
Purpose
LEAST() returns the smallest one of the specified arguments. It is opposite to the GREATEST() function.
This function must have at least two arguments. If any argument is NULL, the return value is NULL.
If the arguments include both a numeric value and a character, the character is implicitly converted into a numeric value. An error is returned if the conversion fails.
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'