VistaDB 5
Gibraltar VistaDB / Developer's Guide / SQL Reference / Functions / Aggregate Functions / SUM
In This Topic
    SUM
    In This Topic

    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