Use the mysql command line to obtain the minimum and maximum values

Source: Internet
Author: User

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 ()

 
 
  1. select MIN(salary) from employee_data;  
  2.    
  3. +-------------+  
  4. | MIN(salary) |  
  5. +-------------+  
  6. |       70000 |  
  7. +-------------+  
  8. 1 row in set (0.00 sec)  
  9.  

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 ()

 
 
  1. select MAX(salary) from employee_data;  
  2.    
  3. +-------------+  
  4. | MAX(salary) |  
  5. +-------------+  
  6. |      200000 |  
  7. +-------------+  
  8. 1 row in set (0.00 sec)  
  9.  

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.