Use GROUP BY clause to get sub-totals.
SELECT and GROUP BY closely integrated: each item in
SELECT list must be single-valued per group, and SELECT
  1. column names
  2. aggregate functions
  3. constants
  4. expression involving combinations of the above.