Oracle Distinct | Oracle Distinct Clause - oracle tutorial - sql tutorial



Oracle distinct

Learn oracle - oracle tutorial - Oracle distinct - oracle examples - oracle programs

What is data manipulation language (DML) ?

  • Oracle DISTINCT clause is used to remove the duplicate records from the result set.
  • It is only used with SELECT statement.
Oracle distinct order by clause

Oracle distinct order by clause

Syntax

SELECT DISTINCT expressions
                     FROM tables
                     WHERE conditions;
click below button to copy the code. By - oracle tutorial - team

Parameters:

expressions:

  • It specifies the columns that you want to retrieve.

tables:

  • It specifies the table from where you want to retrieve records

conditions:

  • It specifies the conditions that must be fulfilled.
oracle tutorial , sql tutorial , sql , pl sql tutorial , oracle , pl sql , plsql

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)  
               )  
               /  
click below button to copy the code. By - oracle tutorial - team
 customer table

Execute this query

SELECT DISTINCT state
FROM customers
WHERE name = 'charu';
click below button to copy the code. By - oracle tutorial - team

Output:

 single expressions output

Oracle DISTINCT Example: (with multiple expressions)

Execute this query

SELECT DISTINCT name, age, salary
FROM customers 
WHERE age >= '60';
click below button to copy the code. By - oracle tutorial - team

Output:

 multiple expressions output
  • This example specifies distinct name, age and salary of the customer where age is greater than or equal to 65.

This tutorial provides an indepth knowledge on the following items such as oracle tutorial , sql tutorial , sql , pl sql tutorial , oracle , pl sql , mysql tutorial , sql tutorial for beginners , learn sql , oracle database tutorial , sql query tutorial , oracle dba tutorial , plsql tutorial , oracle tutorial pdf , oracle pl sql tutorial , oracle sql tutorial , sql tutorial point , oracle tutorial for beginners , learn oracle online free , learn oracle online , learning pl sql programming , learn sql online for free , sql learning online , dba oracle tutorial , oracle sql tutorial advanced , oracle 11g dba tutorial with examples , oracle online learning , oracle learning online , how to learn pl sql , sql coding tutorial , sql learning websites , sql basic learning

Related Searches to Oracle Distinct | Oracle Distinct Clause