VistaDB 5
SUM

Returns the sum of all numeric data, or optionally only the DISTINCT values, in the given expression.
SUM may not be used with non-numeric data types.

For the purposes of the addition NULL values are ignored.

SUM attempts to return a like typed data. So performing SUM() on a BIGINT table will return a BIGINT, FLOAT will return a FLOAT, etc.



Example

SELECT SUM(column) FROM table
SELECT SUM(DISTINCT column) FROM table
See Also