Aggregate Functions
COUNT
Returns the number of rows matching the query criteria.
SELECT COUNT(*) FROM PullRequests WHERE State = 'OPEN'
COUNT(DISTINCT)
Returns the number of distinct, non-null field values matching the query criteria.
SELECT COUNT(DISTINCT Title) AS DistinctValues FROM PullRequests WHERE State = 'OPEN'
AVG
Returns the average of the column values.
SELECT State, AVG(AnnualRevenue) FROM PullRequests WHERE State = 'OPEN' GROUP BY State
MIN
Returns the minimum column value.
SELECT MIN(AnnualRevenue), State FROM PullRequests WHERE State = 'OPEN' GROUP BY State
MAX
Returns the maximum column value.
SELECT State, MAX(AnnualRevenue) FROM PullRequests WHERE State = 'OPEN' GROUP BY State
SUM
Returns the total sum of the column values.
SELECT SUM(AnnualRevenue) FROM PullRequests WHERE State = 'OPEN'