Group by of 13-SQLite, 13-sqlitegroupby

Source: Internet
Author: User

Group by of 13-SQLite, 13-sqlitegroupby
I. group by Overview

Literally, "group by" refers to grouping data according to the rules specified By "by". The so-called grouping refers to dividing a "dataset" into several "small areas ", then data is processed for several "small areas.

Group by is often used with Aggregate functions (avg, count, max, min, sum ).

Ii. Original table


Iii. Case Analysis
1. How many people are there in bj and sz respectively?
Analysis:
Count (*) returns the number of records in the Table. group by addr groups the columns corresponding to addr, bj group and sz group respectively (group by will automatically group according to different addr values)

2. Check the average number of sz and bj instances?
Note: avg (score) calculates the average value.
Iv. Filtering group having
1. View regions with an average score greater than 80

Related Article

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.