DISTINCT¶
The DISTINCT
clause returns only unique (distinct) values from a column or a set of columns, eliminating duplicate rows in the result set.
Syntax¶
SELECT DISTINCT <column_name> [ ,... ]
FROM <table_name>
Arguments¶
Parameter |
Description |
---|---|
|
The columns from which to retrieve distinct values |
|
The table from which to retrieve the data |
Examples¶
SELECT
COUNT(DISTINCT department_id)
FROM
employees;