...

Database Managment - Oracle

Back to Course

Lesson Description


Lession - #1430 Oracle DISTINCT Clause


Oracle DISTINCT Clause

Oracle DISTINCT proviso is utilized to eliminate the copy records from the outcome set. It is just utilized with SELECT proclamation.
Syntax:

SELECT DISTINCT expressions  
FROM tables  
WHERE conditions;  

Oracle DISTINCT Example: (with single expression>

Let's take a table "customers" Customer table:

CREATE TABLE  "CUSTOMERS"   
   (    "NAME" VARCHAR2(4000>
, "AGE" NUMBER, "SALARY" NUMBER, "STATE" VARCHAR2(4000>
>
/

Execute this query:

SELECT DISTINCT state  
FROM customers  
WHERE name = 'charu';  


Oracle DISTINCT Example: (with multiple expressions>

Execute this query:

SELECT DISTINCT name, age, salary  
FROM customers  
WHERE age >= '60';