---
metadata:
  - name: generator
    content: Diplodoc Platform v5.51.0
alternate:
  - https://e2e.viewer-test.ydocs.io/en/yql/syntax/select/distinct.md
  - https://e2e.viewer-test.ydocs.io/ru/yql/syntax/select/distinct.md
  - href: https://e2e.viewer-test.ydocs.io/en/yql/syntax/select/distinct.md
    type: text/markdown
    title: Markdown version
  - href: https://e2e.viewer-test.ydocs.io/en/llms.txt?revision=ytsaurus-test-revision5
    rel: describedby
---
> **Documentation Index:** Fetch the complete configuration index at https://e2e.viewer-test.ydocs.io/en/llms.txt?revision=ytsaurus-test-revision5

# 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://e2e.viewer-test.ydocs.io/en/yql/syntax/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://e2e.viewer-test.ydocs.io/en/yql/builtins/aggregation.md) only to distinct values. For more information, see the documentation for [GROUP BY](https://e2e.viewer-test.ydocs.io/en/yql/syntax/group_by.md).

