Friday 1 April 2016

SQL Least

This will give the least number.

    Syntax: least (value1, value2, value3 … valuen)    

     Ex:
          SQL> select least(1, 2, 3), least(-1, -2, -3) from dual;

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

Ø If all the values are zeros then it will display zero.
Ø If all the parameters are nulls then it will display nothing.
Ø  If any of the parameters is null it will display nothing.

No comments:

Post a Comment