The method for obtaining the minimum and maximum values in the mysql command line is not very complex. The following describes how to use the mysql command line to obtain the minimum and maximum values for your reference.
Built-in functions for mysql to increase the maximum and minimum values of supply and demand. Today, we will learn how to calculate the minimum and maximum values?
In fact, mysql provides 5 aggregate functions ):
MIN (): Minimum Number
MAX (): Maximum Number
SUM (): Number
AVG (): Average Value
COUNT (): calculates the number of occurrences.
1. mysql calculates the minimum value of the column-MIN ()
- select MIN(salary) from employee_data;
-
- +-------------+
- | MIN(salary) |
- +-------------+
- | 70000 |
- +-------------+
- 1 row in set (0.00 sec)
-
In the above example, we find the minimum value of the salary column-MIN (salary) from the employee data table (employee_data)
2. mysql calculates the maximum value of a column-MAX ()
- select MAX(salary) from employee_data;
-
- +-------------+
- | MAX(salary) |
- +-------------+
- | 200000 |
- +-------------+
- 1 row in set (0.00 sec)
-
In the preceding example, we can find the maximum value-MAX (salary) of the salary column from the employee data table (employee_data)
MySQL chain table usage
Analysis of MySQL Chinese Table creation Problems
Disadvantages of MySQL memory tables
Implementation of MySQL multi-Table Deletion
Quick table creation in mysql