The use of the aggregate function of SQLite

Source: Internet
Author: User
Tags sqlite

An aggregate function performs a calculation on a set of values and returns a single value. An aggregate function performs a calculation on a set of values and returns a single value. In addition to COUNT, the aggregate function ignores null values. Aggregate functions are often used with the GROUP by clause of a SELECT statement.

COUNT (*)--Returns the number of specified tables

For example: SELECT COUNT (*) from Studen (where ...);



SUM (*)-Returns the sum of data (only works on numeric type fields)

For example:


Returns the sum of the three subjects: select sum (Math) +sum (Chinese) +sum (chinese version) from student;

In summary, an aggregate function is a calculation of the return result of a query, and then returns a value.

The use of the aggregate function of SQLite

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.