# COALESCE

Returns the first argument that is not null. If all arguments are null, it returns `null`.

## Syntax

`COALESCE(first, rest)`

### Parameters

#### `first`

Expression to evaluate.

#### `rest`

Other expressions to evaluate.

## Examples

Returning the first non-null value

```esql
ROW a=null, b="b"
| EVAL COALESCE(a, b)
```

#### Result

| a    | b   | EVAL_COALESCE_a_b |
|------|-----|-------------------|
| null | "b" | "b"               |

COALESCE supports any number of rest parameters:

```esql
ROW x=null, y=null, z="z"
| EVAL first_non_null = COALESCE(x, y, z)
```
