SQL Functions
Aggregate
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.
Was this page helpful?
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
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?