By default, SQL shows all the data retrieved through
query as output. However, there can be duplicate values.
The SELECT statement when combined with DISTINCT
clause, returns records without repetition (distinct
records). For example, while retrieving employee’s
department number, there can be duplicate values as
many employees are assigned to same department. To
display unique department number for all the employees,
we use DI STI NCT as shown below:
my sql > SELECT DISTINCT Dept Id> FROM EMPLOYEE;