Distinct Keyword in SQL

The DISTINCT keyword is used to retrieve the unique records by eliminating the all duplicate records.

Syntax:

SELECT DISTINCT column1, column2,.....columnN FROM tableName WHERE [condition]

Example:

SELECT DISTINCT EMP_NAME FROM EMPLOYEE;

Output:

EMP_NAME
Nidhi
Parbhjot
Parmender