New versions: Dev (3.16) | Latest (3.15)

LOG10

Applies to ✅ Open Source Edition   ✅ Express Edition   ✅ Professional Edition   ✅ Enterprise Edition

The LOG10() function calculates the logarithm of a numeric value, given base 10.

SELECT log10(100);
create.select(log10(100)).fetch();

The result being

+-------+          
| log10 |
+-------+
|     2 |
+-------+

Dialect support

This example using jOOQ:

log10(100)

Translates to the following dialect specific expressions:

-- ACCESS, ASE, AURORA_MYSQL, AURORA_POSTGRES, BIGQUERY, DB2, DERBY, EXASOL, FIREBIRD, H2, HSQLDB, IGNITE, INFORMIX, MARIADB, 
-- MEMSQL, MYSQL, POSTGRES, SQLDATAWAREHOUSE, SQLSERVER, SYBASE, VERTICA
log10(100)

-- COCKROACHDB
(ln(CAST(100 AS numeric)) / ln(CAST(10 AS numeric)))

-- HANA, ORACLE, SNOWFLAKE, YUGABYTE
log(10, 100)

-- REDSHIFT, TERADATA
log(100)

-- SQLITE
/* UNSUPPORTED */

(These are currently generated with jOOQ 3.16, see #10141), or translate your own on our website

Feedback

Do you have any feedback about this page? We'd love to hear it!

The jOOQ Logo