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

SQL Select Distinct

Get our latest blog posts delivered to your inbox

Subscribe and get popular blog posts about software testing industry.

Rajkumar

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

  1. Finds a bug please refer attached Screenshot.

    • Thanks for pointing out Rahul. Will modify it.

Leave a Comment

Share via
Copy link
Powered by Social Snap