---
title: "LOG"
description: "La funzione SQL LOG restituisce il logaritmo di un numero in una base specificata."
language: it
source_language: en
translation_state: complete
canonical: https://documentation.invantive.eu/it/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/it/
---

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

## Scopo
La funzione SQL `LOG` restituisce il logaritmo naturale di un numero in una base specificata.

Vedi anche [[LN]] e [[EXP]].

Parametri:
- Dato (`decimal`): un numero di cui calcolare il logaritmo.
- Base (facoltativa, `decimal`): la base da cui calcolare il logaritmo. Il valore predefinito è il numero e.

Restituisce: il logaritmo naturale del valore immesso nella base specificata.

## Esempi
L'esempio seguente calcola il logaritmo di 8 in base 2:
```sql
select log(8, 2)

-------------------
3
```
L'esempio seguente calcola il logaritmo di 100 in base 10:
```sql
select log(100, 10)

-------------------
2
```
L'esempio seguente restituisce il logaritmo naturale di 1:
```sql
select log(1)

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

