Aggregate Functions
COUNT
Returns the number of rows matching the query criteria.
SELECT COUNT(*) FROM Dataset_Opportunity WHERE StageName = 'Closed Won'
COUNT(DISTINCT)
Returns the number of distinct, non-null field values matching the query criteria.
SELECT COUNT(DISTINCT Name) AS DistinctValues FROM Dataset_Opportunity WHERE StageName = 'Closed Won'
AVG
Returns the average of the column values.
SELECT CloseDate, AVG(Size) FROM Dataset_Opportunity WHERE StageName = 'Closed Won' GROUP BY CloseDate
MIN
Returns the minimum column value.
SELECT MIN(Size), CloseDate FROM Dataset_Opportunity WHERE StageName = 'Closed Won' GROUP BY CloseDate
MAX
Returns the maximum column value.
SELECT CloseDate, MAX(Size) FROM Dataset_Opportunity WHERE StageName = 'Closed Won' GROUP BY CloseDate
SUM
Returns the total sum of the column values.
SELECT SUM(Size) FROM Dataset_Opportunity WHERE StageName = 'Closed Won'