René Nyffenegger's collection of things on the web
René Nyffenegger on Oracle - Most wanted - Feedback
 

log [Oracle SQL]

log(base, n)
base must be positive and neither 0 nor 1.
n must be positive. 0 is not a positive number!
The number returned by log is such that power(base, returned-number) = n:
create table log_example (
  base  number,
  n     number
);
insert into log_example values (  5,   4);
insert into log_example values (0.2,  33);
insert into log_example values (1.4, 4.2);
insert into log_example values ( 25, 0.8);
insert into log_example values (3.3, 4.4);
select power( base , log(base,n) ) , n
  from log_example;
POWER(BASE,LOG(BASE,N))          N
----------------------- ----------
                      4          4
                     33         33
                    4.2        4.2
                     .8         .8
                    4.4        4.4
See also ln.