Collection Contents Previous Next PDF

ASA SQL Reference

SQL Functions

Alphabetical list of functions

SUM function [Aggregate]


Function 

Returns the total of the specified expression for each group of rows.

Syntax 

SUM ( expression | DISTINCT column-name )

Parameters 

expression    The object to be summed. This is commonly a column name.

DISTINCT column-name    This is of limited usefulness, but is included for completeness.

Usage 

Rows where the specified expression is NULL are not included.

Returns NULL for a group containing no rows.

Standards and compatibility 
See also 
Example 

The following statement returns the value 3749146.

SELECT SUM( salary )
FROM Employee

Collection Contents Previous Next PDF