Aggregate

0001-01-01

What is an SQL Aggregate?

It’s the reduce half of map/reduce: an aggregate computes a single result per group, and GROUP BY defines the groups.

0001-01-01

The FILTER Clause: Multiple Counts in One Pass

count(*) FILTER (WHERE condition) computes conditional aggregates without CASE expressions or separate subqueries — one scan, multiple results.

0001-01-01

percentile_cont(): Many Percentiles in One Query

Median, 90th, 95th, and 99th percentile — computed together in a single pass with an ordered-set aggregate.