pub enum AggregateFunc {
Show 19 variants
Count,
Sum,
Total,
Avg,
Min,
Max,
GroupConcat,
JsonGroupArray,
JsonbGroupArray,
JsonGroupObject,
JsonbGroupObject,
Median,
GeopolyGroupBbox,
VectorSum,
VectorAvg,
Percentile,
PercentileCont,
PercentileDisc,
External,
}Expand description
An aggregate built-in.
Variants§
Count
count(x) and count(*)
Sum
sum(x)
Total
total(x)
Avg
avg(x)
Min
min(x)
Max
max(x)
GroupConcat
group_concat(x[, sep]) and string_agg(x, sep)
JsonGroupArray
json_group_array(x)
JsonbGroupArray
jsonb_group_array(x)
JsonGroupObject
json_group_object(label, x)
JsonbGroupObject
jsonb_group_object(label, x)
Median
median(x), which is percentile_cont(x, 0.5) under a shorter name.
GeopolyGroupBbox
geopoly_group_bbox(P), the box that holds every polygon in the group.
VectorSum
sum(v) and total(v) over a vector column, component by component.
Not a name a caller writes: the binder picks it when sum’s argument
reads a vector, because that is where the argument’s type is known.
VectorAvg
avg(v) over a vector column, component by component.
Percentile
percentile(x, p), where p runs 0 to 100.
PercentileCont
percentile_cont(x, f), where f runs 0 to 1 and the answer is
interpolated between the two rows it falls between.
PercentileDisc
percentile_disc(x, f), which answers one of the rows rather than a
value between two of them.
External
An aggregate an application registered, named beside the call.
The name is not in here because this enum is Copy and travels through
the program’s operands; it rides in AggregateCall instead.