---
metadata:
  - name: generator
    content: Diplodoc Platform v5.63.0
alternate:
  - https://ydb.tech/docs/en/yql/reference/syntax/select/where.md
  - https://ydb.tech/docs/ru/yql/reference/syntax/select/where.md
  - href: https://ydb.tech/docs/en/yql/reference/syntax/select/where.md
    type: text/markdown
    title: Markdown version
  - href: https://ydb.tech/docs/en/llms.txt?revision=a35149bdee1cbbc820c9e5a2b730d682f7173115&version=v26.3
    rel: describedby
sourcePath: en/core/yql/reference/syntax/select/where.md
---
> **Documentation Index:** Fetch the complete configuration index at https://ydb.tech/docs/en/llms.txt?revision=a35149bdee1cbbc820c9e5a2b730d682f7173115&version=v26.3

# WHERE

Filtering rows in the `SELECT`  result based on a condition in [row-oriented](https://ydb.tech/docs/en/concepts/datamodel/table.md#row-oriented-tables) or [column-oriented](https://ydb.tech/docs/en/concepts/datamodel/table.md#column-oriented-tables).

## Example

```yql
SELECT key FROM my_table
WHERE value > 0;
```

{% note warning %}

Correlated subqueries in `WHERE` are not supported: a subquery cannot refer to columns or table aliases from an outer query. To select rows that have matching rows in another table, use [`LEFT SEMI JOIN`](https://ydb.tech/docs/en/yql/reference/syntax/correlated-subqueries.md#exists). To select rows without matches, use [`LEFT ONLY JOIN`](https://ydb.tech/docs/en/yql/reference/syntax/correlated-subqueries.md#not-exists).

{% endnote %}
