SQL statement count vs. GROUP by

Source: Internet
Author: User

1. Multi-line function

which

Max (field)-----------Maximum value

Min (field)----------Minimum value

sum (field)-----------sum

AVG (field)-------------averaging

Cont (field or *)----------count the field data, * Calculate the number of rows of data

Several are multi-line functions, if there is such a function in the statement without writing groupby a field

The function avg () calculates all the rows of data and gets a single data, which is a multiline function, and if you have a function in your statement, such as AVG (), and you do not write a group by a field, then the function avg () calculates all rows of data to get a result.

SQL statement count vs. GROUP by

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.