Updated on 2026-11-06 GMT+08:00

log10

The log10 function is used to return the base-10 logarithm (common logarithm) of the given numeric value.

Syntax

log10(DOUBLE a) 

Parameters

Parameter

Mandatory

Type

Description

a

Yes

DOUBLE, BIGINT, DECIMAL, or STRING

The format of parameter a includes floating-point format, integer format, and string format. If parameter a is not of type DOUBLE, it is implicitly converted to DOUBLE type before evaluation.

Return Values

Returns a value of type DOUBLE.

If a is 0, negative, or NULL, NULL is returned.

Example Code

Returns NULL.

select log10(null); 

Returns NULL.

select log10(0); 

Returns 0.9542425094393249.

select log10(9); 

Returns 1.

select log10(10);