SQL SELECT UNIQUE is used to select unique data entries in a table.

It is an old syntax which was used in oracle but later ANSI changed the keyword to DISTINCT officially.

The syntax of SELECT UNIQUE statement is

SELECT UNIQUEcolumn_name
FROMtable_name;

 

Example:

Let us take a table Student where the cities of two students are same.

StudentIDStudent_NameAddressCity
1NithinBank StreetHyderabad
2BharathWhite FieldBangalore
3GouthamAvenue colonyChennai

 

SELECT UNIQUE City FROM Student;

 

Now only the unique city data will be displayed

Hyderabad
Bangalore