User-defined aggregate functions can be used in SQL DML statements just like built-in aggregate functions. They can appear in the SELECT list, ORDER BY clause, or as part of a predicate in the HAVING clause.
Applicability
This topic applies only to OceanBase Database Enterprise Edition. OceanBase Database Community Edition does not support this feature.
This topic continues to use the SecMax() function as an example to explain how to use user-defined aggregate functions.
The following example shows how to use a user-defined aggregate function in a SELECT statement.
SELECT SecMax(salary), deptno
FROM emp
GROUP BY deptno
HAVING SecMax(salary) > 6000;
