# SQL SELECT DISTINCT Statement

### 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

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

The following SQL statement selects only the DISTINCT values from the "Country" column in the "Customers" table:

**SELECT**&#x20;

The following SQL statement selects all (and duplicate) values from the "Country" column in the "Customers" table[»](https://www.w3schools.com/sql/trysql.asp?filename=trysql_select_no_distinct)<br>

```sql
SELECT Country FROM Customers;
```

Now, let us use the DISTINCT keyword with the above SELECT statement and see the result.<br>

**SELECT DISTINCT Examples**

The following SQL statement selects only the DISTINCT values from the "Country" column in the "Customers" table:

```sql
SELECT COUNT(DISTINCT Country) FROM Customers;
```

&#x20;The following SQL statement lists the number of different (distinct) customer countries:

```sql
SELECT COUNT(DISTINCT Country) FROM Customers;
```

#### Problems :

1. Consider the below data from 'Order' table, write a SQL to fetch the unique regions.
2. Write a SQL to find the list of Items sold.

![](https://826093633-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LS8lPNzCGPR5-DLbGXv%2F-LTDf_4o2PAGOB0Ua1dF%2F-LTDj0SvZ10-qY34Uw60%2Fimage.png?alt=media\&token=e881e4e4-2d10-4fb0-a368-a649104e6120)
