A GROUP BY statement groups a result set by one or more columns.

Syntax

SELECT [ DISTINCT ]
{ * | projectItem [, projectItem ]* }
FROM tableExpression
[ GROUP BY { groupItem [, groupItem ]* } ];

Example

SELECT Customer, SUM(OrderPrice) FROM xxx
GROUP BY Customer;