LEAST()
This page is part of MariaDB's Documentation.
The parent of this page is: Functions for MariaDB Xpand
Topics on this page:
Overview
Returns the argument with the least value from a list of arguments.
USAGE
LEAST(value, value[, value ...])
Argument Name | Description |
---|---|
| Two or more values to compare |
DETAILS
LEAST()
is a comparison function that returns the argument with the least value in the argument list.
The return value is always the first value in the list of arguments that has the least value in the list, so any equivalent values later in the list are never returned (such as a value that differs only in case when comparing CHAR
values).
A NULL
is returned if any of the arguments is NULL
.
EXAMPLES
SELECT LEAST(1, 0),
LEAST(1.0, 2.0, 5.0, 10.0),
LEAST('b', 'B', 'a', 'A')\G
*************************** 1. row ***************************
LEAST(1, 0): 0
LEAST(1.0, 2.0, 5.0, 10.0): 1.0
LEAST('b', 'B', 'a', 'A'): a