Last Updated: May 3, 2026
Standard aggregate functions like COUNT and SUM reduce rows to a single number per group. But two common reporting needs fall outside that pattern: combining text values from multiple rows into a single string, and computing different aggregates for different subsets of rows within the same GROUP BY.
String aggregation and conditional aggregation handle these cases, and both come up regularly in SQL interviews.