SQL 24 🛢️ Removing Duplicates with DISTINCT
A query returns rows. Sometimes those rows contain duplicates. The DISTINCT clause removes them. It tells the database to return only the unique combinations of the selected columns. If two rows have the same values in every selected column, only one is returned. The DISTINCT clause is the tool for answering questions like “Which cities…