The DISTINCT keyword is used to remove duplicates from the output of a SELECT statement.

Structure

SELECT DISTINCT [EXPRESSION]
FROM TABLE
WHERE [CONSTRAINTS];

Example

We want to list all the users and exclude those users who have duplicate entries

SELECT DISTINCT first_name, last_name, user_name, email, role, active from users;