Module org.jooq
Package org.jooq

Interface AggregateFunction<T>

All Superinterfaces:
AggregateFilterStep<T>, Field<T>, FieldOrConstraint, FieldOrRow, GroupField, Named, OrderField<T>, QueryPart, SelectField<T>, SelectFieldOrAsterisk, Serializable, Typed<T>, WindowBeforeOverStep<T>, WindowOverStep<T>
All Known Subinterfaces:
GroupConcatOrderByStep, GroupConcatSeparatorStep, QOM.AnyValue<T>, QOM.ArrayAgg<T>, QOM.Avg, QOM.BitAndAgg<T>, QOM.BitOrAgg<T>, QOM.BitXorAgg<T>, QOM.BoolAnd, QOM.BoolOr, QOM.Collect<T,​A>, QOM.Corr, QOM.Count, QOM.CountTable, QOM.CovarPop, QOM.CovarSamp, QOM.JSONArrayAgg<J>, QOM.JSONObjectAgg<J>, QOM.Max<T>, QOM.Median, QOM.Min<T>, QOM.Mode<T>, QOM.MultisetAgg<R>, QOM.Product, QOM.RatioToReport, QOM.RegrAvgX, QOM.RegrAvgY, QOM.RegrCount, QOM.RegrIntercept, QOM.RegrR2, QOM.RegrSlope, QOM.RegrSxx, QOM.RegrSxy, QOM.RegrSyy, QOM.StddevPop, QOM.StddevSamp, QOM.Sum, QOM.VarPop, QOM.VarSamp, QOM.XMLAgg

public interface AggregateFunction<T> extends AggregateFilterStep<T>
An aggregate function.

An aggregate function is a special field that is usually used in a GROUP BY context. It is also the base for window function construction.

Example:

 // Assuming import static org.jooq.impl.DSL.*;

 using(configuration)
    .select(ACTOR.LAST_NAME, count())
    .from(ACTOR)
    .groupBy(ACTOR.LAST_NAME)
    .orderBy(count().desc())
    .fetch();
 

Instances can be created using various DSL methods and their overloads, such as DSL.count() or DSL.countDistinct(Field).

Author:
Lukas Eder