---
metadata:
  - name: generator
    content: Diplodoc Platform v5.52.0
alternate:
  - https://ydb.tech/docs/en/yql/reference/syntax/select/distinct.md
  - https://ydb.tech/docs/ru/yql/reference/syntax/select/distinct.md
  - href: en/yql/reference/syntax/select/distinct.md
    type: text/markdown
    title: Markdown version
  - href: ../../../../llms.txt
    type: text/markdown
    title: llms.txt
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).

{% 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) 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).

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).

