DISTINCT

SQL DISTINCT Keyword

The SELECT DISTINCT command returns only distinct or different values in the result set. It is used to eliminate duplicate entries and show only one instance of each unique value.

Tutorials dojo strip

SQL DISTINCT Syntax

SELECT DISTINCT column1, column2, ...
FROM table_name;

SQL DISTINCT Example

The following SQL statement selects only the distinct values from the gender column in the Patients table, This will return a list of all unique values found in the gender column such as F or M without repeating them:

SELECT DISTINCT gender FROM Patients;

SQL DISTINCT Labs

Tutorials dojo strip
Scroll to Top