> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sdf.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Conditional Expression Functions

## `booland`

returns result of logical (Boolean) AND of x and y
*Supported Signatures*

```sql theme={null}
function booland(decimal(38, 0), decimal(38, 0)) returns boolean
```

[🔗 Official Documentation](https://docs.snowflake.com/en/sql-reference/functions/booland)

## `boolnot`

returns result of logical (Boolean) NOT of x
*Supported Signatures*

```sql theme={null}
function boolnot(decimal(38, 0)) returns boolean
```

[🔗 Official Documentation](https://docs.snowflake.com/en/sql-reference/functions/boolnot)

## `boolor`

returns result of logical (Boolean) OR of x and y
*Supported Signatures*

```sql theme={null}
function boolor(decimal(38, 0), decimal(38, 0)) returns boolean
```

[🔗 Official Documentation](https://docs.snowflake.com/en/sql-reference/functions/boolor)

## `boolxor`

returns result of logical (Boolean) XOR of x and y
*Supported Signatures*

```sql theme={null}
function boolxor(decimal(38, 0), decimal(38, 0)) returns boolean
```

[🔗 Official Documentation](https://docs.snowflake.com/en/sql-reference/functions/boolxor)

## `coalesce`

returns the first non-null expression among its arguments
*Supported Signatures*

```sql theme={null}
function coalesce($1, ...) returns $1
```

[🔗 Official Documentation](https://docs.snowflake.com/en/sql-reference/functions/coalesce)

## `decode`

compare an expression to search values and returns the matching one
*Supported Signatures*

```sql theme={null}
function decode($1, $1, $1, ...) returns $1
```

[🔗 Official Documentation](https://docs.snowflake.com/en/sql-reference/functions/decode)

## `equal_null`

Checks if two values are equal, with NULL=NULL semantic
*Supported Signatures*

```sql theme={null}
function equal_null($1, $1) returns boolean
function equal_null(array, array) returns boolean
```

[🔗 Official Documentation](https://docs.snowflake.com/en/sql-reference/functions/equal_null)

## `greatest`

returns the largest value from a list of expressions
*Supported Signatures*

```sql theme={null}
function greatest($1, ...) returns $1
```

[🔗 Official Documentation](https://docs.snowflake.com/en/sql-reference/functions/greatest)

## `greatest_ignore_nulls`

returns the largest value from a list of expressions
*Supported Signatures*

```sql theme={null}
function greatest_ignore_nulls($1, ...) returns $1
```

[🔗 Official Documentation](https://docs.snowflake.com/en/sql-reference/functions/greatest_ignore_nulls)

## `iff`

Returns arg2 if arg1 is true, arg3 otherwise.
*Supported Signatures*

```sql theme={null}
function iff(boolean, $1, $1) returns $1
```

[🔗 Official Documentation](https://docs.snowflake.com/en/sql-reference/functions/iff)

## `ifnull`

Returns second expression if the first expression is NULL, the first expression otherwise.
*Supported Signatures*

```sql theme={null}
function ifnull($1, $1) returns $1
```

[🔗 Official Documentation](https://docs.snowflake.com/en/sql-reference/functions/ifnull)

## `is_null_value`

Returns true if VARIANT value is null
*Supported Signatures*

```sql theme={null}
function is_null_value(variant) returns boolean
```

[🔗 Official Documentation](https://docs.snowflake.com/en/sql-reference/functions/is_null_value)

## `least`

returns the smallest value from a list of expressions
*Supported Signatures*

```sql theme={null}
function least($1, ...) returns $1
```

[🔗 Official Documentation](https://docs.snowflake.com/en/sql-reference/functions/least)

## `least_ignore_nulls`

returns the smallest value from a list of expressions
*Supported Signatures*

```sql theme={null}
function least_ignore_nulls($1, ...) returns $1
```

[🔗 Official Documentation](https://docs.snowflake.com/en/sql-reference/functions/least_ignore_nulls)

## `nullif`

*Supported Signatures*

```sql theme={null}
function nullif($1, $1) returns $1
```

[🔗 Official Documentation](https://docs.snowflake.com/en/sql-reference/functions/nullif)

## `nullifzero`

Returns the 1st input, with values equal to 0 replaced with NULL
*Supported Signatures*

```sql theme={null}
function nullifzero(decimal(38, 0)) returns decimal(38, 0)
function nullifzero(double) returns double
```

[🔗 Official Documentation](https://docs.snowflake.com/en/sql-reference/functions/nullifzero)

## `nvl`

Returns second expression if the first expression is NULL, the first expression otherwise.
*Supported Signatures*

```sql theme={null}
function nvl($1, $1) returns $1
```

[🔗 Official Documentation](https://docs.snowflake.com/en/sql-reference/functions/nvl)

## `nvl2`

Returns second expression if the first expression is NOT NULL. Returns the third expression otherwise.
*Supported Signatures*

```sql theme={null}
function nvl2($1, $1, $1) returns $1
```

[🔗 Official Documentation](https://docs.snowflake.com/en/sql-reference/functions/nvl2)

## `regr_valx`

Returns the value of the dependent variable (2nd param) if both values are not-null.
*Supported Signatures*

```sql theme={null}
function regr_valx(double, double) returns double
```

[🔗 Official Documentation](https://docs.snowflake.com/en/sql-reference/functions/regr_valx)

## `regr_valy`

Returns the value of the independent variable (1st param) if both values are not-null.
*Supported Signatures*

```sql theme={null}
function regr_valy(double, double) returns double
```

[🔗 Official Documentation](https://docs.snowflake.com/en/sql-reference/functions/regr_valy)

## `zeroifnull`

Converts to zero if the input is NULL
*Supported Signatures*

```sql theme={null}
function zeroifnull(decimal(38, 0)) returns decimal(38, 0)
function zeroifnull(double) returns double
```

[🔗 Official Documentation](https://docs.snowflake.com/en/sql-reference/functions/zeroifnull)
