Available in versions: Dev (3.20) | Latest (3.19) | 3.18 | 3.17 | 3.16 | 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:

ASE, Access, Aurora MySQL, Aurora Postgres, BigQuery, ClickHouse, DB2, Derby, DuckDB, Exasol, Firebird, H2, HSQLDB, Informix, MariaDB, MemSQL, MySQL, Postgres, SQLDataWarehouse, SQLServer, SQLite, Sybase, Trino, Vertica

log10(100)

CockroachDB

(ln(CAST(100 AS decimal)) / ln(CAST(10 AS decimal)))

Hana, Oracle, Snowflake, YugabyteDB

log(10, 100)

Redshift, Teradata

log(100)
Generated with jOOQ 3.20. Translate your own SQL on our website

Feedback

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

The jOOQ Logo