Training
Module
Learn coding practices to help prevent the occurrence of NullReferenceException.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
is null
operatorApplies to: Databricks SQL
Databricks Runtime
Tests whether expr
is NULL
.
expr is [not] null
expr
: An expression of any type.A BOOLEAN
.
If not
is specified this operator is a synonym for isnotnull(expr)
.
Otherwise the operator is a synonym for isnull(expr)
.
If expr
is a VARIANT
result of a:
parse_json
function,variant_explode
table-valued function, orvariant_explode_outer
table-valued functionthe result of is null
is always false
.
Use the is_variant_null
function 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
.
> SELECT 1 is null;
false
> SELECT 1 is not null;
true
Training
Module
Learn coding practices to help prevent the occurrence of NullReferenceException.
Documentation
NULL semantics - Azure Databricks - Databricks SQL
Learn about SQL null semantics in Databricks SQL and Databricks Runtime.
coalesce function - Azure Databricks - Databricks SQL
Learn the syntax of the coalesce function of the SQL language in Databricks SQL and Databricks Runtime.
current_timestamp function - Azure Databricks - Databricks SQL
Learn the syntax of the current\_timestamp function of the SQL language in Databricks SQL and Databricks Runtime.