DISTINCT keyword is used together with SELECT clause to eliminate all duplicate records in the result set and return only unique records.
Basic syntax of DISTINCT keyword
SELECT DISTINCT column1, column2,.....columnN
FROM table_name
[WHERE conditions]
Returned records will be considered different if they differ in at least one column.
For example:
SELECT DISTINCT NAME, AGE
FROM USER
may return:
Ann 21
Ann 28
John 31
John 23
Войдите чтобы поставить Нравится
Войдите чтобы прокомментировать