GROUP BY
Like distinct in that it will get all unique sets of rows that are included in the select.
All columns in the select must be in the group by, except for aggregates.
Basic
SELECT colName
FROM SchameName.TableName
GROUP BY colName
Two columns
SELECT colName, colName2
FROM SchameName.TableName
GROUP BY colName, colName2 -- colName2 must be included here or you will get an errorWith Aggregates
Count of the number of rows for each unique colName value
SELECT
colName,
COUNT(*)
FROM SchemaName.TableName
GROUP BY colName