SQL DISTINCT keyword

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

 
Next Topic: SQL SELECT TOP with example.
Previous Topic: SQL UNIQUE keyword with example.