SQL UNIQUE keyword

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

Syntax:

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

UNIQUE and DISTINCT statements are same and will give the same result sets.

Example:

SELECT UNIQUE EMP_NAME FROM EMPLOYEE;

Output:

EMP_NAME
Nidhi
Parbhjot
Parmender

  Next Topic: SQL DISTINCT keyword with example. Previous Topic: SQL SELECT statement with example.

 

Please follow and like us:
Content Protection by DMCA.com