Skip to main content

Aggregate Functions

SyntaxDescriptionExampleNormal QueryPushdown QueryDefined as Computed ColumnSuggested as Computed Column
AVG(numeric)Returns the average (arithmetic mean) of numeric across all input valuesSELECT AVG(PRICE) FROM KYLIN_SALES
= 49.23855638491023
✔️✔️
SUM(numeric)Returns the sum of numeric across all input valuesSELECT SUM(PRICE) FROM KYLIN_SALES
= 244075.5240
✔️✔️
MAX(value)Returns the maximum value of value across all input valuesSELECT MAX(PRICE) FROM KYLIN_SALES
= 99.9865
✔️✔️
MIN(value)Returns the minimum value of value across all input valuesSELECT MIN(PRICE) FROM KYLIN_SALES
= 0.0008
✔️✔️
COUNT(value)Returns the number of input rows for which value is not null (wholly not null if value is composite)SELECT count(PRICE) FROM KYLIN_SALES
= 4957
✔️✔️
COUNT(*)Returns the number of input rowsSELECT COUNT(*) FROM KYLIN_COUNTRY
= 244
✔️✔️
CORR(value1, value2)Returns the correlation of two columnsSELECT CORR(ITEM_COUNT, PRICE) FROM KYLIN_SALES
= 0.1278
✔️✔️