User-Defined Aggregates
A user-defined aggregate is an aggregate that you define to perform an aggregate computation that the database server does not provide. For example, you can create a user-defined aggregate named SUMSQ that returns the sum of the squared values of a specified column. User-defined aggregates can work with built-in data types or extended data types or both, depending on how you define the support functions for the user-defined aggregate.
SELECT SUMSQ(digits) FROM test;
For more information on how to create user-defined aggregates, see CREATE AGGREGATE statement and the discussion of user-defined aggregates in HCL OneDB™ User-Defined Routines and Data Types Developer's Guide. For information on how to invoke user-defined aggregates, see User-Defined Aggregates.