Aggregates

An aggregate is a set of functions that returns information about a set of query results.

For example, the built-in SUM aggregate adds the values returned from a query and returns the result. An aggregate is invoked in SQL as a single function, but it is implemented as one or more support functions.

You can define two types of aggregates:
  • Built-in aggregates whose support functions are overloaded to work with extended data types
  • New, user-defined aggregates that implement user-defined routines.

The built-in aggregates are AVG, COUNT, MAX, MIN, SUM, RANGE, STDEV, and VARIANCE. The COUNT aggregate is defined for all data types. For more information about these aggregates, see the Informix® Guide to SQL: Syntax.

For more information about defining aggregates, see the Informix DataBlade® Developers Kit User's Guide.