What is DISTINCT keyword used for in SQL?
Explanation
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

Слідкуй за CodeGalaxy

Мобільний додаток Beta

Get it on Google Play
Зворотній Зв’язок
Cosmo
Зареєструйся Зараз
або Підпишись на майбутні тести