Skip to main content

LOG, LOG2, and LOG10 functions

LOG function

Returns the logarithm to the specified base of the argument.

Syntax

LOG(base, expression)

Arguments

  • base: Specifies the base

  • expression: An expression that evaluates to a numeric value.

Returns

The returned value is a DOUBLE of the logarithm of the input expression to the specified base.

Examples

> SELECT LOG(2, 64);
 6

LOG2 function

Returns the base 2 logarithm of the argument. This is equivalent to LOG(2, expression).

Syntax

LOG2(expression)

Examples

> SELECT LOG2(64);
 6

LOG10 function

Returns the base 10 logarithm of the argument. This is equivalent to LOG(10, expression).

Syntax

LOG10(expression)

Examples

> SELECT LOG10(100);
 2