DISTINCT Keyword
The SELECT DISTINCT statement is used for returning only distinct (different) values from a column.
Syntax
SQL
SELECT DISTINCT <COLUMNS> FROM <TABLE_NAME>;Example 1
SQL
SELECT DISTINCT * FROM Employee;In the above example, only the different/distinct row will be displayed.
Example 2
SQL
SELECT DISTINCT Emp_Name FROM Employee;In above example only different names will be displayed.
Summary
It is used to select only different values from the table.

Join the conversation! Your thoughts help the community grow.