Sum (open)

Aggregate function which returns the sum of values

Syntax

// Core function, no LOADLIB necessary

VARIANT FUNCTION Sum(VARIANT data)

Parameters

VARIANT data

Array of expressions

Return value

VARIANT

Returns the sum of expressions

Description

Sum is an aggregate function which can be used in SELECT statements, and which returns the sum of expressions. Sum can only be used within a SELECT statement, and specifically only in the HAVING, ORDER BY clauses and in the list of selected cells.

Examples

// Show per car maker the total cost of all their models
  SELECT maker, Sum(price)
    FROM car_types
GROUP BY maker