bugl
bugl
HomeLearnPatternsSearch
HomeLearnPatternsSearch

Loading lesson path

Learn/SQL/SQL References
SQL•SQL References

MySQL LOG() Function

Concept visual

MySQL LOG() Function

Pointer walk
two pointers
leftright102132436485116
left=0
right=6
1
3

Start at both ends

Example

Return the natural logarithm of 2:

SELECT LOG(2);

Definition and Usage

The LOG() function returns the natural logarithm of a specified number, or the logarithm of the number to the specified base.

Note:

See also the LN()

and

Exp()

functions.

Syntax

Log(

number )

OR:

Log(

base, number )

Parameter Values

Parameter

Description number

Required. A number. Must be greater than 0 base The base of number. Must be greater than 1

Technical Details

Works in:

From MySQL 4.0

More Examples

Example

Return the natural logarithm of 4 to a specified base (2):

SELECT LOG(2, 4);

Previous

❮ MySQL Functions

Next

Previous

MySQL LN() Function

Next

MySQL LOG10() Function