There no point in using the ``++DISTINCT++`` qualifier on columns with unique values; there can be no duplicates, so there's nothing to eliminate. Further, using this keyword redundantly can slow performance because many optimizers don't remove it, so an unnecessary de-duplication step is run anyway.


This rule raises an issue when ``++DISTINCT++`` is applied to non-compound key columns, and to columns with ``++UNIQUE++`` constraints.


== Noncompliant Code Example

----
SELECT DISTINCT id, -- Noncompliant
  name
FROM employee
WHERE ...
----


== Compliant Solution

----
SELECT id,
  name
FROM employee
WHERE ...
----


