Try OpenEdge Now
skip to main content
SQL Reference
SQL Reference : OpenEdge SQL Functions : SUM
 

SUM

Returns the sum of the values in a group. The keyword DISTINCT specifies that the duplicate values are to be eliminated before computing the sum.

Syntax

SUM ( {[ALL]expression}|{ DISTINCT column_ref} )

Notes

*The argument column_ref or expression can be of any type.
*The result of the function is of the same data type as that of the argument except that the result is of type INTEGER when the argument is of type SMALLINT or TINYINT.
*The result can have a NULL value.

Example

This example illustrates the SUM function:
SELECT SUM (amount)
FROM orders
WHERE order_date = SYSDATE ;