---
title: "LOG"
description: "La fonction SQL LOG renvoie le logarithme d\u0027un nombre dans une base sp\u00E9cifi\u00E9e."
language: fr
source_language: en
translation_state: complete
canonical: https://documentation.invantive.eu/fr/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:46Z
license: https://documentation.invantive.eu/fr/
---

## Syntaxe
```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))
```

## Objet
La fonction SQL `LOG` calcule le logarithme naturel d'un nombre selon une base spécifiée.

Voir également [[LN]] et [[EXP]].

Paramètres :
- Entrée (`decimal`) : un nombre dont on souhaite calculer le logarithme.
- Base (facultative, `decimal`) : la base à partir de laquelle calculer le logarithme. La valeur par défaut est le nombre e.

Renvoie : le logarithme naturel de la valeur d'entrée dans la base spécifiée.

## Exemples
L'exemple suivant calcule le logarithme de 8 en base 2 :
```sql
select log(8, 2)

-------------------
3
```
L'exemple suivant calcule le logarithme de 100 en base 10 :
```sql
select log(100, 10)

-------------------
2
```
L'exemple suivant calcule le logarithme naturel de 1 :
```sql
select log(1)

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

