MySQL Wildcards

MySQL Wildcards

MySQL Aliases

MySQL Aliases

MySQL Data Types

MySQL Data Types

MySQL Interview Questions

MySQL Interview Questions and Answers


MySQL min() Function

The MySQL min() function returns the minimum value from specific field. It is used when you need to find smallest value from fields value.

MySQL MIN FUNCTION Syntax

To find smallest value from specific field in a table, use the following syntax:

Syntax

SELECT MIN(col1) 
FROM tablename
WHERE condition;

Parameters:

tablename: The table name from which you want to fetch records.

col1: The column or field name from which the smallest value will be return.

condition: To specifies the conditions that must be fulfilled. It is optional.

MySQL MIN FUNCTION example

The following MySQL, find smallest value of the numeric field "workingHours" in the "tblCustomerLoan" table:

Example

SELECT MIN(workingHours) AS MinHover FROM tblCustomerLoan;

Note:

In the above example, we are finding smallest value from "workingHours" numeric field in tblCustomerLoan" table.

You can use MySQL Command Line Client to find minimum value from the fields in the specified table. It will look like this: