Distinct

SQL DISTINCT

The DISTINCT is used into a select query to eliminate duplicate records and returns the unique values.

Syntax

SELECT DISTINCT name_of_column FROM name_of_table;

Example

Table of books

IDNAMEPRICE
1Learn Python45
2MySQL Tutorial32
3PHP examples24
4Learn SQL32
SELECT DISTINCT price FROM books;

Output

PRICE
45
32
24