Tag archive
Commands grouped around the same concept, pattern, or recurring problem.
Aggregate a result set into a single row that reports how many rows matched.
Count only the distinct values in a column, ignoring duplicates.
Group rows by the candidate key and keep only values that appear more than once.
Aggregate rows by category with `GROUP BY` and count how many rows fall into each group.
Use more than one column in `GROUP BY` when each combination defines a separate aggregate bucket.
`COUNT(column)` skips `NULL` values, while `COUNT(*)` counts every row that made it into the result set.