Aggregate functions operate on values across rows to make calculations such as sum, average, minimum/maximum, and count. These functions take 0 or more rows and produce a single output.
SELECT COUNT(*) FROM Account WHERE Industry = 'Floppy Disks'
SELECT COUNT(DISTINCT BillingState) AS DistinctValues FROM Account WHERE Industry = 'Floppy Disks'
SELECT Name, AVG(AnnualRevenue) FROM Account WHERE Industry = 'Floppy Disks' GROUP BY Name
SELECT MIN(AnnualRevenue), Name FROM Account WHERE Industry = 'Floppy Disks' GROUP BY Name
SELECT Name, MAX(AnnualRevenue) FROM Account WHERE Industry = 'Floppy Disks' GROUP BY Name
SELECT SUM(AnnualRevenue) FROM Account WHERE Industry = 'Floppy Disks'
Was this page helpful?