---
metadata:
  - name: generator
    content: Diplodoc Platform v5.71.0
alternate:
  - https://ydb.tech/docs/en/yql/reference/syntax/select/distinct.md?version=v26.3
  - https://ydb.tech/docs/ru/yql/reference/syntax/select/distinct.md?version=v26.3
  - href: https://ydb.tech/docs/en/yql/reference/syntax/select/distinct.md?version=v26.3
    type: text/markdown
    title: Markdown version
  - href: https://ydb.tech/docs/en/llms.txt?revision=962422e645f28cc9d83f45f9bb5846da6ee2ca46&version=v26.3
    rel: describedby
sourcePath: en/core/yql/reference/syntax/select/distinct.md
---
> **Documentation capabilities:** Search, read sources, and browse this documentation: [agent guide](https://ydb.tech/docs/docs-api/agent/overview?project=ydb-platform--ydb&lang=en&version=v26.3).

> **Documentation Index:** Fetch the complete configuration index at https://ydb.tech/docs/en/llms.txt?revision=962422e645f28cc9d83f45f9bb5846da6ee2ca46&version=v26.3

# 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=v26.3).

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

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=v26.3).

