| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell98 |
Opaleye.Aggregate
Description
Perform aggregations on query results.
- groupBy :: Aggregator (Column a) (Column a)
- sum :: Aggregator (Column a) (Column a)
- count :: Aggregator (Column a) (Column Int64)
- avg :: Aggregator (Column Double) (Column Double)
- aggregate :: Aggregator a b -> Query a -> Query b
- data Aggregator a b
Documentation
groupBy :: Aggregator (Column a) (Column a) Source
Group the aggregation by equality on the input to groupBy.
sum :: Aggregator (Column a) (Column a) Source
Sum all rows in a group.
aggregate :: Aggregator a b -> Query a -> Query b Source
Given a Query producing rows of type a and an Aggregator accepting rows of
type a, apply the aggregator to the results of the query.
data Aggregator a b Source
An Aggregator takes a collection of rows of type a, groups
them, and transforms each group into a single row of type b. This
corresponds to aggregators using GROUP BY in SQL.
Instances