LEAST()
function returns the least or smallest value in a list of values. It needs at least one argument to work with, and if you mix different types, like a text and a number, it will return an error.
For example, comparing the greatest value among 4, “two”, and 9 would result in an error.
LEAST()
function is as follows:
value_1
: Represents the first value.value_n
: Represents one or more additional values, separated by commas.NULL
values in the list will be ignored. NULL
if all the expressions evaluate to NULL
.LEAST()
function:
3
, the smallest value among the provided values.
'a'
, as it is the smallest string.
NULL
values are ignored when determining the smallest value:
5
.
-8
, the smallest value among the provided numbers.
grades
containing columns x
, y
, and z
.
least_grade
to the result, displaying the smallest value among columns x
, y
, and z
.