MySQL LEAST() Function

Return the smallest value of the list of arguments

Definition and Usage

The LEAST() function returns the smallest value of the list of arguments.

Note: See also the GREATEST() function.

Syntax

LEAST(arg1, arg2, arg3, ...)

Parameter Values

Parameter Description
arg1, arg2, arg3, ... Required. The list of arguments to be evaluated

Technical Details

Works in: From MySQL 4.0

More Examples

Example

Return the smallest value of the list of arguments:

SELECT LEAST("w3resource.net", "microsoft.com", "apple.com");