# IFNULL() Function

### Description

Returns the first non-null value — expression when it is not NULL, otherwise fallback.

### Syntax

```sql
IFNULL(expression, fallback)
```

### Parameters

| Parameter | Description | Data Type | Required |
| --- | --- | --- | --- |
| _expression_ | Value to return when it is not NULL | Any | Yes |
| _fallback_ | Value to return when expression is NULL | Any | Yes |

#### Notes

-   Behaves like `COALESCE(expression, fallback)`; parser normalizes to `COALESCE`.

### Example

```sql
SELECT
    IFNULL(NULL, 'fallback')
FROM
    my_table t
LIMIT
    1;
```

Source: https://developer.rippling.com/documentation/rippling-platform/transformations/sql-reference/ifnull

> For the complete documentation index, see [llms.txt](https://developer.rippling.com/llms.txt). Public pages have a Markdown version at the same URL with .md added.
