Junior SQL

What is the purpose of the DISTINCT keyword in SQL?

The DISTINCT keyword is used to return only unique values in the result set, removing any

duplicate rows.

Example:

SELECT DISTINCT Country FROM Customers;

This will return a list of unique countries from the Customers table.

More from SQL Server Tutorial

All questions for this course