-
public interface OrderedAggregateFunctionOfDeferredType
An ordered-set aggregate function.An ordered-set aggregate function is an aggregate function with a mandatory Oracle-specific
WITHIN GROUP (ORDER BY ..)
clause. An example isLISTAGG
:
The above function groups books by author and aggregates titles into a concatenated string.SELECT LISTAGG(TITLE, ', ') WITHIN GROUP (ORDER BY TITLE) FROM T_BOOK GROUP BY AUTHOR_ID
Ordered-set aggregate functions can be further converted into window functions using the
OVER(PARTITION BY ..)
clause. For example:SELECT LISTAGG(TITLE, ', ') WITHIN GROUP (ORDER BY TITLE) OVER (PARTITION BY AUTHOR_ID) FROM T_BOOK
- Author:
- Lukas Eder
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <T> @NotNull AggregateFilterStep<T>
withinGroupOrderBy(OrderField<T> field)
Add anWITHIN GROUP (ORDER BY ..)
clause to the ordered aggregate function
-
-
-
Method Detail
-
withinGroupOrderBy
@NotNull @Support({AURORA_POSTGRES,H2,POSTGRES_9_4}) <T> @NotNull AggregateFilterStep<T> withinGroupOrderBy(OrderField<T> field)
Add anWITHIN GROUP (ORDER BY ..)
clause to the ordered aggregate function
-
-