LEAST()

Overview

Returns the argument with the least value from a list of arguments.

USAGE

LEAST(value, value[, value ...])

Argument Name

Description

value

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.

SYNONYMS

SCHEMA

PARAMETERS

SKYSQL

PRIVILEGES

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

ERROR HANDLING

FEATURE INTERACTION

RESPONSES

DIAGNOSIS

ISO 9075:2016

CHANGE HISTORY

Release Series

History

23.09

  • Present starting in MariaDB Xpand 23.09.1.

6.1

  • Present starting in MariaDB Xpand 6.1.0.

6.0

  • Present starting in MariaDB Xpand 6.0.3.

5.3

  • Present starting in MariaDB Xpand 5.3.13.

Release Series

History

6.0

  • Present starting in MariaDB Xpand 6.0.3.

5.3

  • Present starting in MariaDB Xpand 5.3.13.

Release Series

History

6.1

  • Present starting in MariaDB Xpand 6.1.0.

EXTERNAL REFERENCES