Home » MySQL Math LOG() Function

MySQL Math LOG() Function

by Online Tutorials Library

MySQL LOG() Function

The Log() is a Math function of MySQL. This function is used to return either the natural logarithm of the given number if it has one parameter or specified base logarithm number if it has two parameters.

Syntax

Parameters:

number : It is the number for getting natural logarithm value.

base: It is the base of the natural logarithm.

Returns

This function returns the natural logarithm of the given number.

Note:

  1. If the number is less than or equal to 0, this function will return NULL.
  2. If the base is less than or equal to 1, this function will return NULL.

Example 1

Output:

MySQL Math LOG() Function

Example 2

Output:

MySQL Math LOG() Function

Example 3

Output:

MySQL Math LOG() Function

Next TopicMySQL Math

You may also like