Friday 1 April 2016

SQL Greatest

This will give the greatest number.

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

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

GREATEST(1,2,3) GREATEST(-1,-2,-3)
--------------------  -----------------------
              3                    -1

Ø 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