MySQL Tutorial

A database system used with PHP.

MySQL SELECT DISTINCT

The MySQL 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.

Syntax:

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

Try It Yourself

Edit the code below and click Run to see the result live.

Source Code
Result
Topics