GROUP BY
Groups and summarizes by value.
Syntax
SELECT column, COUNT(*) ... GROUP BY column;
Description
Groups rows with the same value; calculates an aggregate function for each group.
Example
Loading editor…
Expected output
Berlin|1 Milan|2
When to use?
Summary by category (people per city, etc.).