SQL > SQL Commands > Select Unique

The SELECT UNIQUE term is an Oracle-only SQL statement. It is equivalent to SELECT DISTINCT. The syntax for SELECT UNIQUE is as follows:

SELECT UNIQUE "column_name"
FROM "table_name";

For example, to select all distinct stores in Table Store_Information,

Table Store_Information

Store_NameSalesTxn_Date
Los Angeles1500Jan-05-1999
San Diego250Jan-07-1999
Los Angeles300Jan-08-1999
Boston700Jan-08-1999

we key in,

SELECT UNIQUE Sales FROM Store_Information;

Result:

Sales
1500
250
300
700

Next: SQL INSERT INTO




Copyright © 2014 1keydata.com   All Rights Reserved.   Privacy Policy