Home › GROUP BY
What is GROUP BY? Definition, Formula & Example
A clause that splits rows into groups by one or more columns to apply aggregates per group; the SQL counterpart of an Excel PivotTable.
Syntax
SELECT col, COUNT(*) FROM t GROUP BY col
Example
Customers per city.
Want an expert to do it for you?
Gomaa Intelligence turns your data into clear reports and decisions. Tell us your problem and we will reply.
FAQ
What is GROUP BY?
A clause that splits rows into groups by one or more columns to apply aggregates per group; the SQL counterpart of an Excel PivotTable.
GROUP BY example
Customers per city.
Glossary
RFM analysis · CAGR · Churn rate · KPI · Conversion rate · Average order value (AOV) · Customer lifetime value (CLV) · Data cleaning · Profit margin · Database · Relational database · Primary key · Foreign key · SQL JOIN · NULL value · SQL query