Skip to content
Iampsp Blog

Iampsp Blog

I am a programming service provider

My Portfolio
Project order
Reviews
Favorite Exchange

Categories

  • C
  • C#
  • C++
  • CSS
  • Firefox Addons
  • Firefox Themes
  • HTML
  • JAVA
  • JavaScript
  • jQuery
  • Mybb Plugins
  • MySQL
  • PHP
  • Python
  • React
  • SQL

Recent Posts

  • jQuery – The noConflict() Method
  • jQuery – AJAX get() and post() Methods
  • jQuery – AJAX load() Method
  • jQuery – AJAX Introduction
  • jQuery Traversing – Filtering

MySQL LOG Function

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.

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);
Posted on 2025-03-11Author MostafaCategories SQLTags mysql command line, mysql count, mysql create user, mysql database, mysql docker, mysql download, mysql insert into, mysql log all queries, mysql log file location linux, mysql log file location windows, mysql log in, mysql log in as root, mysql log level, mysql log location linux, mysql log rotate, mysql log shipping, mysql log slow queries, mysql port, mysql row_number, mysql workbench

Post navigation

Previous Previous post: MySQL LN Function
Next Next post: MySQL LOG10 Function
Proudly powered by WordPress