(Contents)(Previous)(Next)

Eliminating Duplicate Rows

All customer cities are to be retrieved. First all cities are output as often as they are stored.

SELECT city, state

FROM customer

ORDER BY state

This redundancy can be avoided by the usage of DISTINCT.

SELECT DISTINCT city, state

FROM customer

ORDER BY city


(Contents)(Previous)(Next)