Count



Returns the number of values in each group. Count(0) and Count(*) count the documents in each group.

Numeric Count(AggregationArray valuesArray)

Without GROUP BY

When a query has aggregate functions but no Group By, all of the selected documents form a single group.


round-pushpin Counts the words for each language.
SELECT LanguageId, Count(0) as Words FROM WordList:Word GROUP BY LanguageId ORDER BY Count(0) DESC

round-pushpin Counts every document in a schema.
SELECT Count(*) FROM WordList:Word




SQL :: Sha512Agg
Returns a single SHA-512 hash of all of the values in each group, as a lower case hex string. Useful for detecting changes to a set of documents.
SQL :: ShowAggregateFunctions
Lists the built-in aggregate functions with their parameters and descriptions.
SQL :: Sum
Returns the total of the values in each group.
SQL :: Syntax
Basic KBSQL syntax and some examples.
SQL :: Variance
Returns the population variance of the values in each group: how far the values are spread from their mean.