---
metadata:
  - name: generator
    content: Diplodoc Platform v5.52.0
alternate:
  - https://ydb.tech/docs/en/yql/reference/syntax/select/secondary_index.md?version=v25.4
  - https://ydb.tech/docs/ru/yql/reference/syntax/select/secondary_index.md?version=v25.4
  - href: ru/yql/reference/syntax/select/secondary_index.md
    type: text/markdown
    title: Markdown version
  - href: ../../../../llms.txt
    type: text/markdown
    title: llms.txt
sourcePath: ru/core/yql/reference/syntax/select/secondary_index.md
---
> **Documentation Index:** Fetch the complete configuration index at https://ydb.tech/docs/ru/llms.txt

# VIEW (INDEX)

Чтобы сделать запрос `SELECT` по вторичному индексу строковой таблицы, используйте конструкцию:

```yql
SELECT *
    FROM TableName VIEW IndexName
    WHERE …
```

<!-- source: ru/_includes/not_allow_for_olap_note.md -->
{% note warning %}

<!-- source: ru/_includes/not_allow_for_olap_text.md -->
Поддерживается только для [строковых](https://ydb.tech/docs/ru/concepts/datamodel/table.md?version=v25.4#row-oriented-tables) таблиц. Поддержка функциональности для [колоночных](https://ydb.tech/docs/ru/concepts/datamodel/table.md?version=v25.4#column-oriented-tables) таблиц находится в разработке.
<!-- endsource: ru/_includes/not_allow_for_olap_text.md -->

{% endnote %}
<!-- endsource: ru/_includes/not_allow_for_olap_note.md -->

## Примеры

Выбрать все поля из строковой таблицы `series` по индексу `views_index` с условием `views >= someValue`:

```yql
SELECT series_id, title, info, release_date, views, uploaded_user_id
    FROM series VIEW views_index
    WHERE views >= someValue
```

Сделать [`JOIN`](https://ydb.tech/docs/ru/yql/reference/syntax/select/join.md?version=v25.4) строковых таблиц `series` и `users` c заданным полем `userName` по индексам `users_index` и `name_index` соответственно:

```yql
SELECT t1.series_id, t1.title
    FROM series VIEW users_index AS t1
    INNER JOIN users VIEW name_index AS t2
    ON t1.uploaded_user_id == t2.user_id
    WHERE t2.name == userName;
```
