SUM_FLOAT [Aggregate]

Computes the sum of an expression over a group of rows and returns a DOUBLE PRECISION value.

Behavior Type

Immutable

Syntax

SUM_FLOAT ( [ ALL | DISTINCT ] expression )

Parameters

ALL

Invokes the aggregate function for all rows in the group (default).

DISTINCT

Invokes the aggregate function for all distinct non-null values of the expression found in the group.

expression

Any expression whose result is type DOUBLE PRECISION.

Overflow Handling

By default, Vertica allows silent numeric overflow when you call this function on numeric data types. For more information on this behavior and how to change it, see Numeric Data Type Overflow with SUM, SUM_FLOAT, and AVG.

Example

The following query returns the floating-point sum of the average price from the product table:

=> SELECT SUM_FLOAT(average_competitor_price) AS cost FROM product_dimension;
   cost   
----------
 18181102
(1 row)