DISTINCT
Selecting unique rows.
Note
Applying DISTINCT
to calculated values is not currently implemented. For this purpose, use a subquery or the clause GROUP BY ... AS ...
.
Example
SELECT DISTINCT value -- only unique values from the table
FROM my_table;
The DISTINCT
keyword can also be used to apply aggregate functions only to distinct values. For more information, see the documentation for GROUP BY.