---
title: "COALESCE"
description: "Die SQL-Funktion COALESCE f\u00FChrt eine Coalescing-Operation aus und gibt den ersten Nicht-null-Wert zur\u00FCck, andernfalls null."
language: de
source_language: en
translation_state: complete
canonical: https://documentation.invantive.eu/de/docs/invantive-universalsql/grammar/sql-functions/coalesce
original: https://documentation.invantive.eu/en/docs/invantive-universalsql/grammar/sql-functions/coalesce
updated: 2026-12-04T13:26:25Z
license: https://documentation.invantive.eu/de/
---

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

## Anwendung
Die SQL-Funktion `COALESCE` führt eine Coalescing-Operation durch und gibt den ersten Wert zurück, der nicht non-`null` ist; andernfalls wird `null` zurückgegeben.

Siehe auch [[NVL]].

Parameter:
- Position 1 (`ANY`): ein Wert.
- Position n (`ANY`): weitere Werte.

Gibt zurück: den ersten Wert, der nicht non-`null` ist, als Datentyp an der Position 1.

## Beispiele
Das folgende Beispiel ruft das erste Element ab, das nicht non-`null` ist:
```sql
select coalesce(-5, null, -3)

--------
-5
```
Das folgende Beispiel ruft das erste Element ab, das nicht non-`null` ist:
```sql
select coalesce(null, null, -5, -3)

--------
-5
```
Das folgende Beispiel ruft das erste Element ab, das nicht non-`null` ist. Bitte beachten Sie, dass der leere Text in Invantive UniversalSQL die Semantik von `null` hat:
```sql
select coalesce(null, '', 'answer 1', 'answer 2')

--------
answer 1
```

