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. Continue reading MySQL LOG Function
Return the natural logarithm of 2:
SELECT LOG(2);
The LOG() function returns the natural logarithm of a specified number, or the logarithm of the number to the specified base. Continue reading MySQL LOG Function
Return the natural logarithm of 2:
SELECT LN(2);
The LN() function returns the natural logarithm of a number.
Note: See also the LOG() and EXP() functions. Continue reading MySQL LN Function
Return the smallest value of the list of arguments:
SELECT LEAST(3, 12, 34, 8, 25);
The LEAST() function returns the smallest value of the list of arguments.
Note: See also the GREATEST() function. Continue reading MySQL LEAST Function
Return the greatest value of the list of arguments:
SELECT GREATEST(3, 12, 34, 8, 25);
The GREATEST() function returns the greatest value of the list of arguments.
Note: See also the LEAST() function. Continue reading MySQL GREATEST Function
Return the largest integer value that is less than or equal to 25.75:
SELECT FLOOR(25.75);
The FLOOR() function returns the largest integer value that is smaller than or equal to a number.
Note: Also look at the ROUND(), CEIL(), CEILING(), TRUNCATE(), and DIV functions. Continue reading MySQL FLOOR Function
Return e raised to the power of 1:
SELECT EXP(1);
The EXP() function returns e raised to the power of the specified number.
The constant e (2.718281…), is the base of natural logarithms.
Tip: Also look at the LOG() and LN() functions. Continue reading MySQL EXP Function
Integer division (10/5):
SELECT 10 DIV 5;
The DIV function is used for integer division (x is divided by y). An integer value is returned. Continue reading MySQL DIV Function
Convert the radian value into degrees:
SELECT DEGREES(1.5);
The DEGREES() function converts a value in radians to degrees.
Note: See also the RADIANS() and PI() functions. Continue reading MySQL DEGREES Function
Return the number of products in the “Products” table:
SELECT COUNT(ProductID) AS NumberOfProducts FROM Products;
The COUNT() function returns the number of records returned by a select query.
Note: NULL values are not counted. Continue reading MySQL COUNT Function
Return the cotangent of a number:
SELECT COT(6);
The COT() function returns the cotangent of a number.
COT(number)