Friday, 1 April 2016

SQL log

 This is based on 10 based logarithm.

    Syntax: log (10, value)   -- here value must be greater than zero which is positive only.     

    Ex:
          SQL> select log(10,100), log(10,2), log(10,1), log(10,null) from dual;

LOG(10,100)  LOG(10,2)  LOG(10,1) LOG(10,NULL)
---------------     -----------     ------------  -----------------
                             2            .301029996          0

LN (value) = LOG (EXP(1), value)

SQL> select  ln(3), log(exp(1),3) from dual;

                        LN(3)      LOG(EXP(1),3)
                         -------      -----------------
                     1.09861229    1.09861229

No comments:

Post a Comment