It is often desirable to return the results of a query with no duplicates. The
keyword DISTINCT prevents duplicates from being returned. Figure
shows the use of the DISTINCT keyword to prevent duplicate states
and duplicate city and state combinations.
DISTINCT prevents duplicates
Notice DISTINCT operates only on the columns selected in the query.
It does not compare non-selected columns when determining uniqueness. Section
shows how counts can be generated for each of the distinct values.