Suggest an editImprove this articleRefine the answer for “How do you select unique rows from a table?”. Your changes go to moderation before they’re published.Approval requiredContentWhat you’re changing🇺🇸EN🇺🇦UAPreviewTitle (EN)Short answer (EN)To select unique rows from a table, use the `DISTINCT` keyword in a `SELECT` command, e.g. `SELECT DISTINCT DepartmentID FROM Employees;` returns every department only once, even if it has several employees. **Key point:** several columns can be used at once (`SELECT DISTINCT Name, DepartmentID FROM Employees;`) - in that case, uniqueness is based on the combination of values across all the listed columns.Shown above the full answer for quick recall.Answer (EN)ImageTo select **unique rows** from a table, use the `DISTINCT` keyword in a `SELECT` command. **Syntax:** ```sql SELECT DISTINCT Column1, Column2, ... FROM Table_Name; ``` **Example:** ```sql SELECT DISTINCT DepartmentID FROM Employees; ``` ### What this query does - Selects only the **unique values** of the `DepartmentID` field from the `Employees` table. - If several employees belong to the same department, `DISTINCT` returns that department only once. **Notes:** - Several columns can be used at once: ```sql SELECT DISTINCT Name, DepartmentID FROM Employees; ``` - In that case, uniqueness is based on the **combination of values across every listed column**. > Put simply, `DISTINCT` helps **remove repeated rows** and get back only unique records from a table.For the reviewerNote to the moderator (optional)Visible only to the moderator. Helps review go faster.