DISTINCT Clause


☞ It eliminates duplicate rows from the results of a SELECT statement.

☞ It is used to retrieve only unique values for a column in table.

☞ The DISTINCT keyword can be used only once with SELECT statement.

Syntax :

SELECT DISTINCT<column_1>, <column_2>, <column_3>, ..... <column_n>
FROM <table_name>;

Example :

SELECT DISTINCT fees, gender
FROM Student;