MySQL min() function

The MySQL min() function is used to return the minimum value from the table.

Syntax:

snippet
SELECT MIN (aggregate_expression)
FROM tables
[WHERE conditions];

Parameter explanation

aggregate_expression: It specifies the column or expression, from which the minimum value will be returned.

table_name: It specifies the tables, from where you want to retrieve records. There must be at least one table listed in the FROM clause.

WHERE conditions: It is optional. It specifies the conditions that must be fulfilled for the records to be selected.

MySQL min() function example

Consider a table named "employees", having the following data.

mysql min() 1

Execute the following query:

snippet
SELECT MIN (working_hours) AS "Minimum working hours"
FROM employees;

Output:

mysql min() 2
Related Tutorial
Follow Us
https://www.facebook.com/Rookie-Nerd-638990322793530 https://twitter.com/RookieNerdTutor https://plus.google.com/b/117136517396468545840 #
Contents +