---
metadata:
  - name: generator
    content: Diplodoc Platform v5.50.6
alternate:
  - https://ydb.tech/docs/en/yql/reference/syntax/select/distinct.md?version=main
  - https://ydb.tech/docs/ru/yql/reference/syntax/select/distinct.md?version=main
sourcePath: en/core/yql/reference/syntax/select/distinct.md
---
> **Documentation Index:** Fetch the complete configuration index at https://ydb.tech/docs/en/llms.txt

# DISTINCT

Selecting unique rows.

{% note info %}

Applying `DISTINCT` to calculated values is not currently implemented. For this purpose, use a subquery or the clause [`GROUP BY ... AS ...`](https://ydb.tech/docs/en/yql/reference/syntax/select/group-by.md?version=main).

{% endnote %}

## Example

```yql
SELECT DISTINCT value -- only unique values from the table
FROM my_table;
```

The `DISTINCT` keyword can also be used to apply [aggregate functions](https://ydb.tech/docs/en/yql/reference/builtins/aggregation.md?version=main) only to distinct values. For more information, see the documentation for [GROUP BY](https://ydb.tech/docs/en/yql/reference/syntax/select/group-by.md?version=main).

Removes duplicate rows from the result. Applies after the clause [`GROUP BY ... AS ...`](https://ydb.tech/docs/en/yql/reference/syntax/select/group-by.md?version=main).

