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