---
title: isnotnull function
description: Learn the syntax of the isnotnull function of the SQL language in Databricks SQL and Databricks Runtime.
canonical_url: https://docs.databricks.com/aws/en/sql/language-manual/functions/isnotnull
---

# `isnotnull` function

**Applies to:** ![check marked yes](https://docs.databricks.com/aws/en/images/icons/check.png) Databricks SQL ![check marked yes](https://docs.databricks.com/aws/en/images/icons/check.png) Databricks Runtime

Returns `true` if `expr` is not `NULL`. This function is a synonym for `expr IS NOT NULL`.

## Syntax

```
isnotnull(expr)
```

## Arguments

* `expr`: An expression of any type.

## Returns

A `BOOLEAN`.

If `expr` is a `VARIANT` result of a:

* [JSON path expression](https://docs.databricks.com/aws/en/sql/language-manual/sql-ref-json-path-expression.md) with a valid path,
* [`parse_json` function](https://docs.databricks.com/aws/en/sql/language-manual/functions/parse_json.md),
* [`variant_explode` table-valued function](https://docs.databricks.com/aws/en/sql/language-manual/functions/variant_explode.md), or
* [`variant_explode_outer` table-valued function](https://docs.databricks.com/aws/en/sql/language-manual/functions/variant_explode_outer.md)

the result is always `true`.
Use the [`is_variant_null` function](https://docs.databricks.com/aws/en/sql/language-manual/functions/is_variant_null.md) function to check if the `VARIANT` encoded value is `NULL`, or cast the `VARIANT` to a specific type and check if the result is `NULL`.

## Examples

```sql
> SELECT isnotnull(1);
 true

> SELECT isnotnull(NULL:INTEGER);
 false

> SELECT isnotnull(parse_json('{"key": null}'):key);
 true

> SELECT isnotnull(parse_json('{"key": null}'):wrongkey);
 false

> SELECT !is_variant_null(parse_json('{"key": null}'):key);
 false
```

## Related functions

* [`isnull` function](https://docs.databricks.com/aws/en/sql/language-manual/functions/isnull.md)
* [`isnan` function](https://docs.databricks.com/aws/en/sql/language-manual/functions/isnan.md)
* [`is null` operator](https://docs.databricks.com/aws/en/sql/language-manual/functions/isnullop.md)
* [`is_variant_null` function](https://docs.databricks.com/aws/en/sql/language-manual/functions/is_variant_null.md)
