GROUP BY

GROUP BY is an SQL statement for organizing the results of a query into groups by one or more columns. It is used in conjunction with aggregation functions that act on one or more columns of data.

Example:

SELECT city, avg(hhinc) as average FROM table GROUP BY city