ID EN
Comparison Functions and Operators

LEAST(value1,value2,...)

MySQL 8.4

With two or more arguments, returns the smallest (minimum-valued) argument. The arguments are compared using the following rules:

Syntax

MYSQL
SELECT LEAST(2,0);
0
SELECT LEAST(34.0,3.0,5.0,767.0);
3.0
SELECT LEAST('B','A','C');
'A'

Examples

Example

If any argument is NULL, the result is NULL. No comparison is needed.

MYSQL
SELECT LEAST(2,0);
0
SELECT LEAST(34.0,3.0,5.0,767.0);
3.0
SELECT LEAST('B','A','C');
'A'