

# `DISTINCT` and `ALL`

`SELECT DISTINCT` returns each distinct row of the result once. `SELECT ALL`, the default, keeps duplicate rows.

## Syntax
<a name="athena-duckdb-statement-select-distinct-syntax"></a>

```sql
SELECT DISTINCT {{select_list}}
```

## Examples
<a name="athena-duckdb-statement-select-distinct-examples"></a>

For a description of the sample tables that the examples on this page use, see [SELECT statement in DuckDB](duckdb-statement-select.md).

The following SQL query returns each region once.

```sql
SELECT DISTINCT region
FROM sales_db.sales_parquet
ORDER BY region
```

The query returns the following results.


| region | 
| --- | 
| `east` | 
| `north` | 
| `west` | 

## Considerations
<a name="athena-duckdb-statement-select-distinct-considerations"></a>

To keep one row for each distinct value of some columns, filter on `row_number()` in a `QUALIFY` clause. For example, `QUALIFY row_number() OVER (PARTITION BY region ORDER BY amount DESC NULLS LAST) = 1` keeps the largest order in each region. For more information about `QUALIFY`, see [`QUALIFY` clause](duckdb-statement-select-qualify.md).