---
title: "LPAD"
description: "LPAD SQL\u95A2\u6570\u306F\u3001\u30C6\u30AD\u30B9\u30C8\u3092\u5DE6\u5074\u306B\u30D1\u30C7\u30A3\u30F3\u30B0\u3057\u3066\u6307\u5B9A\u306E\u9577\u3055\u306B\u3057\u307E\u3059\u3002"
language: ja
source_language: en
translation_state: complete
canonical: https://documentation.invantive.eu/ja/docs/invantive-universalsql/grammar/sql-functions/lpad
original: https://documentation.invantive.eu/en/docs/invantive-universalsql/grammar/sql-functions/lpad
updated: 2026-12-04T13:56:27Z
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)) --> LPAD[LPAD]:::quoted
    LPAD --> End((END))
```

## 目的
`LPAD` SQL関数は、テキストを左側にパディングして指定の長さにします。

参照：[[RPAD]]。

パラメータ:
- 入力 (`varchar2`): パディングするテキスト。
- 長さ (`int32`): テキストをパディングする長さ。0 から 67,108,864 まで。
- 文字 (省略可能、`varchar2`): パディングに使用する文字。 既定値は空白です。

戻り値: 指定の長さになるように、省略可能な指定文字で左側をパディングしたテキスト。

## 例
次の例では、`abc` を空白で埋めて5文字の長さにします:
```sql
select lpad('abc', 5)

-------------------
  abc
```
次の例では、`abc` を `*` で埋めて5文字の長さにします:
```sql
select lpad('abc', 5, '*')

-------------------
**abc
```
次の例では、要求された長さが入力の長さより短いため、`abc` を1文字の長さに切り詰めます:
```sql
select lpad('abc', 1)

-------------------
a
```

