SUM() Function


 

SQLite: SUM Function

This SQLite tutorial explains how to use the SQLite SUM Function with syntax and examples.

 

Description:
The SQLite SUM function returns the summed value of an expression.

 
Syntax:

 

Parameters or Arguments:

expression1, expression2, … expression_n

Expressions that are not encapsulated within the SUM function and must be included in the GROUP BY clause at the end of the SQLite statement.

aggregate_expression

This is the column or expression that will be summed.

tables

The tables that you wish to retrieve records from. There must be at least one table listed in the FROM clause.

conditions

These are conditions that must be met for the records to be selected.

 

Examples:
The following SQLite statement returns the sum of all the “salary” column from the “Account” table:

SUM(salary)
210000