TheDeveloperBlog.com

Home | Contact Us

C-Sharp | Java | Python | Swift | GO | WPF | Ruby | Scala | F# | JavaScript | SQL | PHP | Angular | HTML

Oracle DISTINCT Clause

Oracle Distinct Clause for beginners and professionals with examples on insert, select, update, delete, table, view, join, key, functions, procedures, indexes, cursor etc.

<< Back to ORACLE

Oracle DISTINCT Clause

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

Syntax:

SELECT DISTINCT expressions
FROM tables
WHERE conditions;

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 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)
   )
/
Customer Table

Execute this query:

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

Output:

oracle distinct query 1

Oracle DISTINCT Example: (with multiple expressions)

Execute this query:

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

Output:

oracle distinct query 1

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

Next TopicOracle FROM Clause




Related Links:


Related Links

Adjectives Ado Ai Android Angular Antonyms Apache Articles Asp Autocad Automata Aws Azure Basic Binary Bitcoin Blockchain C Cassandra Change Coa Computer Control Cpp Create Creating C-Sharp Cyber Daa Data Dbms Deletion Devops Difference Discrete Es6 Ethical Examples Features Firebase Flutter Fs Git Go Hbase History Hive Hiveql How Html Idioms Insertion Installing Ios Java Joomla Js Kafka Kali Laravel Logical Machine Matlab Matrix Mongodb Mysql One Opencv Oracle Ordering Os Pandas Php Pig Pl Postgresql Powershell Prepositions Program Python React Ruby Scala Selecting Selenium Sentence Seo Sharepoint Software Spellings Spotting Spring Sql Sqlite Sqoop Svn Swift Synonyms Talend Testng Types Uml Unity Vbnet Verbal Webdriver What Wpf