---
title: "LN"
description: "The LN SQL function gets the natural logarithm of a number."
language: en
source_language: en
translation_state: complete
canonical: https://documentation.invantive.eu/en/docs/invantive-universalsql/grammar/sql-functions/ln
original: https://documentation.invantive.eu/en/docs/invantive-universalsql/grammar/sql-functions/ln
updated: 2026-08-09T00:00:00Z
license: https://documentation.invantive.eu/en/
---

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

## Purpose
The `LN` SQL function gets the natural logarithm of a number. In contrast to [[LOG]], no base can be specified; the base is always the number `e`.

See also [[LOG]] and [[EXP]].

Parameters:
- Input (`decimal`): a number to get the natural logarithm from.

Returns: the natural logarithm of the input.

## Examples
The following example retrieves the natural logarithm of 1:
```sql
select ln(1)

-------------------
0
```
The following example retrieves the natural logarithm of the number e:
```sql
select ln(exp(1))

-------------------
1
```