MySQL Learning Note (v) commonly used aggregation functions

Source: Internet
Author: User

1. COUNT (E1)

Syntax: COUNT (E1)parameter: E1 is an expression that can be any data typereturn: Return numeric datafunction: Returns e1 the total number of records for which the specified column is not empty Example:
1) Use alone      2) combined with group by       2.Syntax: SUM (E1)parameter: E1 is an expression of type numericreturn: Return numeric datafunction: Sums the columns specified by the E1Example: 1) use alone 2) combined with GROUP by 3, MIN (E1), MAX (E1)
Syntax: MIN (E1), MAX (E1)parameter: E1 is an expression of a character, date, or numeric type. If the E1 is a character type, the maximum and minimum values are judged according to the ASCII code. return: Returns the data of the corresponding type according to the type of the E1 parameter. function: Min (e1) returns the minimum value in the column specified by the E1 expression;Max (E1) returns the maximum value in the column specified by the E1 expression;Example: 1) 2) 4, AVG
Syntax: AVG (E1)parameter: E1 is an expression of a numeric typereturn: Returns a numeric type datafunction: Averages the columns specified by the E1 expression. Example: 1)2)      

MySQL Learning Note (v) commonly used aggregation functions

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.