SQL Distinct Clause - How to use Distinct in SQL
Demo wikitechydatabase
- Below is a selection from the wikitechytable table used in the examples:
The SQL SELECT DISTINCT Statement
- The SELECT DISTINCT statement is used to return only distinct (different) values.
- Inside a table, a column often contains many duplicate values; and sometimes you only want to list the different (distinct) values.
SELECT DISTINCT Syntax
SELECT DISTINCT column1, column2, ... FROM table_name;
SELECT DISTINCT Examples
- The following SQL statement selects only the DISTINCT values from the "name" column in the "wikitechytable" table:
SELECT DISTINCT name FROM wikitechytable