LEAST function

The least function returns the smallest value in a list. The syntax for the least function is:

least( expr1, expr2, ... expr_n )

If the data types of the expressions are different, all expressions are converted to expr1's data type. If a NULL value is in the list, least function returns NULL.


SQL> select least(1, 2, 3, 4) from dual;

LEAST(1,2,3,4)
--------------
             1

SQL> select least('1', '2', 'a', 'b') from dual;

L
-
1

SQL> select least('a', 'b', 'c') from dual;

L
-
a

SQL> select least('a', 'b', 'c', null) from dual;

L
-
Home »
Oracle »
General Functions » 

Related: