> ## 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.

> すべてのテーブルにあるカラムの情報を含むシステムテーブル

# system.columns

<div id="description">
  ## 説明
</div>

すべてのテーブルのカラムに関する情報が含まれています。

このテーブルを使うと、[DESCRIBE TABLE](/ja/reference/statements/describe-table) クエリと同様の情報を、複数のテーブルについて一度に取得できます。

[一時テーブル](/ja/reference/statements/create/table#temporary-tables) のカラムは、作成されたセッションでのみ `system.columns` に表示されます。これらは `database` フィールドが空の状態で表示されます。

<div id="columns">
  ## カラム
</div>

* `database` ([String](/ja/reference/data-types)) — データベース名。
* `table` ([String](/ja/reference/data-types)) — テーブル名。
* `name` ([String](/ja/reference/data-types)) — カラム名。
* `type` ([String](/ja/reference/data-types)) — カラムの型。
* `position` ([UInt64](/ja/reference/data-types)) — テーブル内のカラムの序数位置。1 から始まります。
* `default_kind` ([String](/ja/reference/data-types)) — デフォルト値の式の種類 (DEFAULT、MATERIALIZED、ALIAS) 。定義されていない場合は空文字列です。
* `default_expression` ([String](/ja/reference/data-types)) — デフォルト値の式。定義されていない場合は空文字列です。
* `data_compressed_bytes` ([UInt64](/ja/reference/data-types)) — 圧縮データのサイズ (バイト単位) 。
* `data_uncompressed_bytes` ([UInt64](/ja/reference/data-types)) — 非圧縮データのサイズ (バイト単位) 。
* `marks_bytes` ([UInt64](/ja/reference/data-types)) — マークのサイズ (バイト単位) 。
* `comment` ([String](/ja/reference/data-types)) — カラムのコメント。定義されていない場合は空文字列です。
* `is_in_partition_key` ([UInt8](/ja/reference/data-types)) — カラムがパーティション式に含まれているかどうかを示すフラグ。
* `is_in_sorting_key` ([UInt8](/ja/reference/data-types)) — カラムがソートキー式に含まれているかどうかを示すフラグ。
* `is_in_primary_key` ([UInt8](/ja/reference/data-types)) — カラムが主キー式に含まれているかどうかを示すフラグ。
* `is_in_sampling_key` ([UInt8](/ja/reference/data-types)) — カラムがサンプリングキー式に含まれているかどうかを示すフラグ。
* `compression_codec` ([String](/ja/reference/data-types)) — 圧縮コーデック名。
* `character_octet_length` ([Nullable(UInt64)](/ja/reference/data-types)) — バイナリデータ、文字データ、またはテキストデータと画像の最大長 (バイト単位) 。ClickHouse では FixedString データ型に対してのみ意味があります。それ以外の場合は NULL 値が返されます。
* `numeric_precision` ([Nullable(UInt64)](/ja/reference/data-types)) — 近似数値データ、正確な数値データ、整数データ、または通貨データの精度。ClickHouse では、整数型ではビット幅、Decimal 型では 10 進精度を表します。それ以外の場合は NULL 値が返されます。
* `numeric_precision_radix` ([Nullable(UInt64)](/ja/reference/data-types)) — 近似数値データ、正確な数値データ、整数データ、または通貨データの精度に使われる数値体系の基数。ClickHouse では、整数型では 2、Decimal 型では 10 です。それ以外の場合は NULL 値が返されます。
* `numeric_scale` ([Nullable(UInt64)](/ja/reference/data-types)) — 近似数値データ、正確な数値データ、整数データ、または通貨データのスケール。ClickHouse では Decimal 型に対してのみ意味があります。それ以外の場合は NULL 値が返されます。
* `datetime_precision` ([Nullable(UInt64)](/ja/reference/data-types)) — DateTime64 データ型の 10 進精度。その他のデータ型では NULL 値が返されます。
* `serialization_hint` ([Nullable(String)](/ja/reference/data-types)) — 統計に基づいて INSERT 時のシリアライゼーションを選択するためのカラム向けヒント。
* `statistics` ([String](/ja/reference/data-types)) — このカラムで作成された統計の種類。

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

```sql theme={null}
SELECT * FROM system.columns LIMIT 2 FORMAT Vertical;
```

```text theme={null}
Row 1:
──────
database:                INFORMATION_SCHEMA
table:                   COLUMNS
name:                    table_catalog
type:                    String
position:                1
default_kind:
default_expression:
data_compressed_bytes:   0
data_uncompressed_bytes: 0
marks_bytes:             0
comment:
is_in_partition_key:     0
is_in_sorting_key:       0
is_in_primary_key:       0
is_in_sampling_key:      0
compression_codec:
character_octet_length:  ᴺᵁᴸᴸ
numeric_precision:       ᴺᵁᴸᴸ
numeric_precision_radix: ᴺᵁᴸᴸ
numeric_scale:           ᴺᵁᴸᴸ
datetime_precision:      ᴺᵁᴸᴸ

Row 2:
──────
database:                INFORMATION_SCHEMA
table:                   COLUMNS
name:                    table_schema
type:                    String
position:                2
default_kind:
default_expression:
data_compressed_bytes:   0
data_uncompressed_bytes: 0
marks_bytes:             0
comment:
is_in_partition_key:     0
is_in_sorting_key:       0
is_in_primary_key:       0
is_in_sampling_key:      0
compression_codec:
character_octet_length:  ᴺᵁᴸᴸ
numeric_precision:       ᴺᵁᴸᴸ
numeric_precision_radix: ᴺᵁᴸᴸ
numeric_scale:           ᴺᵁᴸᴸ
datetime_precision:      ᴺᵁᴸᴸ
```
