Distinct Clause in SQL

Distinct Clause in SQL is used to fetch only unique values and remove the duplicate values from the result.

Key – Points :

The changes made by Distinct Clause are not permanent and are not written on disk.These changes are temporarily done in buffer.

Distinct Clause is used in SELECT Statement.

Distinct Clause can be applied to single column or combination of columns.

Syntax :

Distinct Clause for a single column :

SELECT DISTINCT(<Col>) FROM <Tablename>;

Brackets are optional.

Distinct Clause when applied to a single column fetc

Distinct Clause for a multiple columns :

SELECT  DISTINCT  <Col 1> , <Col 2 >….<Col n>  FROM <Tablename>;

Backup Table in SQL
Data Control Language in SQL ( DCL Commands )
Shikha Katariya

Shikha Katariya

Shikha Katariya ,the Blog author is QA Engineer by profession,Currently serving in MNC, She has more than 4 years of experience in software industry and has worked for domains like Insurance , Core & retail Banking. Always keen to learn new technologies , she has working experience in mainframes,informatica ,and ETL Testing.

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *