Tag archive
Commands grouped around the same concept, pattern, or recurring problem.
Divide the sum of value times weight by the sum of weights instead of averaging pre-aggregated values.
Use `SUM(...) OVER ()` to compare each row's value to the total without collapsing the result set.
Use an inclusive start and exclusive end to match a whole date range without missing rows that include times.
Bucket dates into month starts, then aggregate counts or totals per month.
Use more than one column in `GROUP BY` when each combination defines a separate aggregate bucket.