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
  • Method Details

    • keepDenseRankFirstOrderBy

      @NotNull @Support(ORACLE) @Pro @NotNull AggregateFilterStep<T> keepDenseRankFirstOrderBy(OrderField<?>... fields)
      Restrict this aggregate function to FIRST values

      An example:

      
       MAX(id) KEEP (DENSE_RANK FIRST ORDER BY 1)
       
    • keepDenseRankFirstOrderBy

      @NotNull @Support(ORACLE) @Pro @NotNull AggregateFilterStep<T> keepDenseRankFirstOrderBy(Collection<? extends OrderField<?>> fields)
      Restrict this aggregate function to FIRST values

      An example:

      
       MAX(id) KEEP (DENSE_RANK FIRST ORDER BY 1)
       
    • keepDenseRankLastOrderBy

      @NotNull @Support(ORACLE) @Pro @NotNull AggregateFilterStep<T> keepDenseRankLastOrderBy(OrderField<?>... fields)
      Restrict this aggregate function to LAST values

      An example:

      
       MAX(id) KEEP (DENSE_RANK LAST ORDER BY 1)
       
    • keepDenseRankLastOrderBy

      @NotNull @Support(ORACLE) @Pro @NotNull AggregateFilterStep<T> keepDenseRankLastOrderBy(Collection<? extends OrderField<?>> fields)
      Restrict this aggregate function to LAST values

      An example:

      
       MAX(id) KEEP (DENSE_RANK LAST ORDER BY 1)
       
    • $filterWhere

      @Experimental @Nullable @Nullable Condition $filterWhere()
      Experimental query object model accessor method, see also QOM. Subject to change in future jOOQ versions, use at your own risk.