GroupBy Why do you want to cooperate with aggregation function

Source: Internet
Author: User
First, the system obtains a result set according to the SELECT statement, such as a detailed table of the first fruit, the country of production, and the unit price. The records with the same grouping fields are then merged into one record, based on the grouping fields. At this time, the remainder of the field that does not exist in the group by statement is likely to have multiple values, but there is only one record for a grouping, and a data grid cannot fit into multiple values, so there is a need to convert these multivalued columns into single values through some processing. Then put it in the corresponding data grid, then the completion of this step is the aggregation function. This is why these functions are called aggregate functions (aggregate functions).
Why do you use the aggregation function to understand this phrase?

Reply content:

First, the system obtains a result set according to the SELECT statement, such as a detailed table of the first fruit, the country of production, and the unit price. The records with the same grouping fields are then merged into one record, based on the grouping fields. At this time, the remainder of the field that does not exist in the group by statement is likely to have multiple values, but there is only one record for a grouping, and a data grid cannot fit into multiple values, so there is a need to convert these multivalued columns into single values through some processing. Then put it in the corresponding data grid, then the completion of this step is the aggregation function. This is why these functions are called aggregate functions (aggregate functions).
Why do you use the aggregation function to understand this phrase?

If there is no aggregate function, the group's rows will be the first or last (forget) in the group's column, and if there is an aggregate function, those columns can be valued according to your needs.

Group by doesn't fit into the aggregate function, then group by doesn't work.
"Aggregation" as the name implies, a number of values together for some operations, group by IS to say that the values gathered together

  • 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.