---
title: is distinct operator
description: Learn the syntax of the is distinct operator  of the SQL language in Databricks SQL.
canonical_url: https://docs.databricks.com/aws/en/sql/language-manual/functions/isdistinct
---

# `is distinct` operator

**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

Tests whether the arguments have different values where NULLs are considered as comparable values.

## Syntax

```
expr1 is [not] distinct from expr2
```

## Arguments

* `expr1`: An expression of a comparable type.
* `expr2`: An expression of a type sharing a [least common type](https://docs.databricks.com/aws/en/sql/language-manual/sql-ref-datatype-rules.md#least-common-type-resolution) with `expr1`.

## Returns

A BOOLEAN.

If both `expr1` and `expr2` are NULL they are considered not distinct.

If only one of `expr1` and `expr2` is NULL the expressions are considered distinct.

If both `expr1` and `expr2` are not NULL they are considered distinct if `expr` \<> `expr2`.

## Examples

```sql
> SELECT NULL is distinct from NULL;
 false

> SELECT NULL is distinct from 5;
 true

> SELECT 1 is distinct from 5;
 true

> SELECT NULL is not distinct from 5;
 false
```

## Related

* [`=` (eq sign) operator](https://docs.databricks.com/aws/en/sql/language-manual/functions/eqsign.md)
* [`!=` (bangeq sign) operator](https://docs.databricks.com/aws/en/sql/language-manual/functions/bangeqsign.md)
* [`<=>` (lt eq gt sign) operator](https://docs.databricks.com/aws/en/sql/language-manual/functions/lteqgtsign.md)
* [`isnan` function](https://docs.databricks.com/aws/en/sql/language-manual/functions/isnan.md)
* [`is true` operator](https://docs.databricks.com/aws/en/sql/language-manual/functions/istrue.md)
* [SQL data type rules](https://docs.databricks.com/aws/en/sql/language-manual/sql-ref-datatype-rules.md)
