is distinct
operator
Applies to: Databricks SQL 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 withexpr1
.
Returns
A BOOLEAN.
If both expr1
and expr2
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
> 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
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for