-
Notifications
You must be signed in to change notification settings - Fork 665
Aggregators
Mathias Rangel Wulff edited this page Mar 12, 2017
·
7 revisions
- SUM()
- AVG()
- COUNT()
- MAX()
- MIN()
- FIRST()
- LAST()
Examples:
SELECT COUNT()
SELECT COUNT(one)
SELECT COUNT(*)
- AGGR() – operations on aggregated values
- ARRAY() – create array of values
- User-defined aggregators
Example of AGGR() aggregator (here avg1 = avg2)
SELECT SUM(a) AS sm, COUNT(*) AS cnt, \
AGGR(sm/cnt) AS avg1, AVG(a) AS avg2 FROM data
© 2014-2024, Andrey Gershun & Mathias Rangel Wulff
Please help improve the documentation by opening a PR on the wiki repo