---
title: "LOG"
description: "LOG SQL Function (*.fnc)\u306F\u3001\u6307\u5B9A\u3057\u305F\u5E95\u306B\u304A\u3051\u308B\u6570\u5024\u306E\u81EA\u7136\u5BFE\u6570\u3092\u53D6\u5F97\u3057\u307E\u3059\u3002"
language: ja
source_language: en
translation_state: complete
canonical: https://documentation.invantive.eu/ja/docs/invantive-universalsql/grammar/sql-functions/log
original: https://documentation.invantive.eu/en/docs/invantive-universalsql/grammar/sql-functions/log
updated: 2026-12-04T13:55:51Z
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)) --> LOG[LOG]:::quoted
    LOG --> End((END))
```

## 目的
`LOG` SQL Function (*.fnc)は、指定した底における数値の自然対数を取得します。

関連項目：[[LN]]および[[EXP]]。

パラメータ:
- 入力 (`decimal`): 対数を取得する数値。
- 底 (省略可、`decimal`): 対数の底となる値。 既定値は自然対数の底 e です。

戻り値: 指定した底における入力値の自然対数。

## 例
次の例では、底 2 における 8 の対数を取得します:
```sql
select log(8, 2)

-------------------
3
```
次の例では、底 10 における 100 の対数を取得します:
```sql
select log(100, 10)

-------------------
2
```
次の例では、1の自然対数を取得します：
```sql
select log(1)

-------------------
0
```

