> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-fix-nav-issues.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

> dictionary データを ClickHouse のテーブルとして表示します。同様に Dictionary エンジンと同じように動作します。

# dictionary

[dictionary](/ja/reference/statements/create/dictionary) のデータを ClickHouse のテーブルとして表示します。[Dictionary](/ja/reference/engines/table-engines/special/dictionary) エンジンと同じように動作します。

<div id="syntax">
  ## 構文
</div>

```sql theme={null}
dictionary('dict')
```

<div id="arguments">
  ## 引数
</div>

* `dict` — Dictionary名。[String](/ja/reference/data-types/string).

<div id="returned_value">
  ## 戻り値
</div>

ClickHouseのテーブル。

<div id="examples">
  ## 例
</div>

入力テーブル `dictionary_source_table`:

```text theme={null}
┌─id─┬─value─┐
│  0 │     0 │
│  1 │     1 │
└────┴───────┘
```

Dictionaryを作成します:

```sql title="Query" theme={null}
CREATE DICTIONARY new_dictionary(id UInt64, value UInt64 DEFAULT 0) PRIMARY KEY id
SOURCE(CLICKHOUSE(HOST 'localhost' PORT tcpPort() USER 'default' TABLE 'dictionary_source_table')) LAYOUT(DIRECT());
```

```sql title="Query" theme={null}
SELECT * FROM dictionary('new_dictionary');
```

```text title="Response" theme={null}
┌─id─┬─value─┐
│  0 │     0 │
│  1 │     1 │
└────┴───────┘
```

<div id="related">
  ## 関連
</div>

* [Dictionaryエンジン](/ja/reference/engines/table-engines/special/dictionary)
