MySQL MOD Function

Example

Return the remainder of 18/4:

SELECT MOD(18, 4);

Definition and Usage

The MOD() function returns the remainder of a number divided by another number. Continue reading MySQL MOD Function

MySQL MIN Function

Example

Find the price of the cheapest product in the “Products” table:

SELECT MIN(Price) AS SmallestPrice FROM Products;

Definition and Usage

The MIN() function returns the minimum value in a set of values.

Note: See also the MAX() function. Continue reading MySQL MIN Function

MySQL MAX Function

Example

Find the price of the most expensive product in the “Products” table:

SELECT MAX(Price) AS LargestPrice FROM Products;

Definition and Usage

The MAX() function returns the maximum value in a set of values.

Continue reading MySQL MAX Function

MySQL LOG10 Function

Example

Return the base-10 logarithm of 2:

SELECT LOG10(2);

Definition and Usage

The LOG10() function returns the natural logarithm of a number to base-10.

 

Syntax

LOG10(number)

Parameter Values

Parameter Description
number A number greater than 0

Technical Details

Works in: From MySQL 4.0

More Examples

Example

Return the base-10 logarithm of 4.5:

SELECT LOG10(4.5);

MySQL LN Function

Example

Return the natural logarithm of 2:

SELECT LN(2);

Definition and Usage

The LN() function returns the natural logarithm of a number.

Note: See also the LOG() and EXP() functions. Continue reading MySQL LN Function

MySQL LEAST Function

Example

Return the smallest value of the list of arguments:

SELECT LEAST(3, 12, 34, 8, 25);

Definition and Usage

The LEAST() function returns the smallest value of the list of arguments.

Note: See also the GREATEST() function. Continue reading MySQL LEAST Function

MySQL GREATEST Function

Example

Return the greatest value of the list of arguments:

SELECT GREATEST(3, 12, 34, 8, 25);

Definition and Usage

The GREATEST() function returns the greatest value of the list of arguments.

Note: See also the LEAST() function. Continue reading MySQL GREATEST Function

MySQL FLOOR Function

Example

Return the largest integer value that is less than or equal to 25.75:

SELECT FLOOR(25.75);

Definition and Usage

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