---
title: "ZSTD_COMPRESS"
description: "ZSTD_COMPRESS SQL\u95A2\u6570\u306F\u3001Zstandard\u30A2\u30EB\u30B4\u30EA\u30BA\u30E0\u3092\u4F7F\u7528\u3057\u3066BLOB\u3092\u5727\u7E2E\u3057\u307E\u3059\u3002"
language: ja
source_language: en
translation_state: complete
canonical: https://documentation.invantive.eu/ja/docs/invantive-universalsql/grammar/sql-functions/zstd-compress
original: https://documentation.invantive.eu/en/docs/invantive-universalsql/grammar/sql-functions/zstd-compress
updated: 2026-12-04T14:59:00Z
license: https://documentation.invantive.eu/ja/
---

## 構文
```mermaid
%%{init: {
  'theme': 'base',
  'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
  'themeVariables': {
    'fontSize': '11px',
    'fontFamily': 'Arial'
  }
}}%%
flowchart LR
    Start((START)) --> ZSTD_COMPRESS[ZSTD_COMPRESS]:::quoted
    ZSTD_COMPRESS --> End((END))
```

## 目的
`ZSTD_COMPRESS` SQL関数は、Zstandardアルゴリズムを使用して`blob`を圧縮します。

関連項目：[[ZSTD_DECOMPRESS]]および[[ZLIB_COMPRESS]]。

パラメータ:
- input (`blob`): 圧縮する `blob`。

戻り値: 入力のZstandard圧縮版。

## 例
次の例では、ASCII 文字 `ACME` の9文字を圧縮して解凍し、元のテキストを取得します:
```sql
select blob_to_text(zstd_decompress(zstd_compress(ascii_to_blob('ACME'))))

-------------------
ACME
```
次の例では、テキストを圧縮し、圧縮された `blob` を base64 でエンコードしたものを取得します:
```sql
select base64_encode(zstd_compress('VGhpcyBpcyBhIHZlcnkgbG9uZyB0ZXh0IHRvIHRlc3QgdGhlIFpzdGQgY29tcHJlc3Npb24gbWV0aG9k'))

-------------------
KLUv/SA8vQEAwsMMFLAnHd2OTKNtYpi2ISYmwTDAZCECxao8IzN3TMax4dILZvUeu/Ui7ASy4iTxWPjMZwoIAA==
```

