Some queries might return duplicate rows of data. This might happen when selecting just the last names of people listed in a phone book. If you used a simple query of
SELECT surnames FROM phonebook;
you would likely have thousands of duplicated rows for common names such as Moore, Johnston, and Smith.
If you place the DISTINCT clause after the SELECT, multiple values are returned only once.
When the query selects more than one column, DISTINCT only removes duplicate rows where every column value is identical.