Question: how to retrieve unique values from database?
Answer: SELECT DISTINCT returns only distinct (i.e. different) values. SELECT DISTINCT eliminates duplicate records from the results. DISTINCT can be used with aggregates: COUNT, AVG, MAX, etc. DISTINCT operates on a single column. DISTINCT for multiple columns is not supported.