SQL SELECT DISTINCT Statement – SQL TUTORIAL | Software Testing Material

SQL Select Distinct:

SQL SELECT DISTINCT query is used to return only unique values. It eliminates all the duplicated values.

Syntax:

Example:

In the below image, you could find two SELECT queries.

Total number of records displayed in the result are 3 related to the first SELECT query whereas the total number of records displayed in the result are 2 related to the second SELECT query. We used a DISTINCT keyword in the second SELECT query, so all the duplicate values are eliminated and returned only the unique values.

SQL SELECT DISTINCT

In the next tutorial, we will see Union & Union All In SQL

Check out the complete SQL Tutorial by clicking on below link:

SQL Tutorial – Complete

Rajkumar SM is a founder of SoftwareTestingMaterial. He is a certified Software Test Engineer by profession and blogger & youtuber by choice. He has an extensive experience in the field of Software Testing. He writes here about Software Testing which includes both Manual and Automation Testing. He loves to be with his wife and cute little kid 'Freedom'.

2 thoughts on “SQL SELECT DISTINCT Statement – SQL TUTORIAL | Software Testing Material”

Leave a Comment

Share via
Copy link
Powered by Social Snap