Suggest an editImprove this articleRefine the answer for “How do you group data by a single field?”. Your changes go to moderation before they’re published.Approval requiredContentWhat you’re changing🇺🇸EN🇺🇦UAPreviewTitle (EN)Short answer (EN)To group data by a single field, use the `GROUP BY` operator with that field's name, e.g. `GROUP BY department` creates groups by department name, and `COUNT(*)` counts employees in each one. **Key point:** in the result, each output row is **one group** sharing a common field value plus its computed aggregate.Shown above the full answer for quick recall.Answer (EN)ImageTo group data by a single field, use the `GROUP BY` operator with that field's name. ### Example ```sql SELECT department, COUNT(*) FROM employees GROUP BY department; ``` Here: - `GROUP BY department` creates groups by department name, - `COUNT(*)` counts employees **in each department**. In the result, each output row is **one group** sharing a common `department` value plus its computed aggregate.For the reviewerNote to the moderator (optional)Visible only to the moderator. Helps review go faster.