Suggest an editImprove this articleRefine the answer for “What does DISTINCT do?”. Your changes go to moderation before they’re published.Approval requiredContentWhat you’re changing🇺🇸EN🇺🇦UAPreviewTitle (EN)Short answer (EN)`DISTINCT` in SQL is used to select only unique values from a dataset, removing repeated rows; it applies only to the selected columns, not the whole table. **Key point:** with several columns, uniqueness is based on the combination of values across all listed columns - repeated pairs get excluded from the result, which is useful for removing duplicates from query results.Shown above the full answer for quick recall.Answer (EN)Image`DISTINCT` in SQL is used to **select only unique values** from a dataset, removing repeated rows. **A simple usage example:** ```sql SELECT DISTINCT DepartmentID FROM Employees; ``` - Pulls every **unique value** of `DepartmentID`. - If a department shows up for several employees, it appears only once. **An example with several columns:** ```sql SELECT DISTINCT Name, DepartmentID FROM Employees; ``` - Uniqueness is based on the **combination of the** `Name` **and** `DepartmentID` **columns**. - Repeated pairs get excluded from the result. **Notes:** - It applies only to the selected columns, not the whole table. - Useful for **removing duplicates** from query results. > Put simply, `DISTINCT` ensures that **every value or combination of values appears only once** in the result.For the reviewerNote to the moderator (optional)Visible only to the moderator. Helps review go faster.