Curriculum
Course: MYSQL
Login

Curriculum

MYSQL

MySQL References

0/140
Text lesson

LOG

Example

Provide the logarithm base e of 2.

SELECT LOG(2); 

Definition and Usage

The LOG() function retrieves either the natural logarithm or the logarithm of a specified number with a given base.

Note: Additionally, refer to the LN() and EXP() functions.

Syntax

LOG(number)

OR:

LOG(base, number)

Parameter Values

Parameter

Description

number

Mandatory: A numerical value that must exceed zero.

base

The numerical base of the number. It must be greater than 1.

Technical Details

Works in: From MySQL 4.0

More Examples

Example

Provide the logarithm base 2 of 4.

SELECT LOG(24);