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.
SELECT DISTINCT column_name,column_name FROM table_name;
SELECT DISTINCT Fours FROM SCOREBOARD;
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.
In the next tutorial, we will see Union & Union All In SQL
Check out the complete SQL Tutorial by clicking on below link:
Finds a bug please refer attached Screenshot.
Thanks for pointing out Rahul. Will modify it.