Training
Module
Combine query results with set operators - Training
Combine query results with set operators using Transact-SQL.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
equal_null
functionApplies to: Databricks SQL
Databricks Runtime 11.3 LTS and above
Returns true
if expr1
equals expr2
or both expressions are NULL
, or false
otherwise. This function differs from =
(eq sign) operator, by treating NULL
as a comparable value.
equal_null ( expr1, expr2 )
expr1
: An expression of any comparable type.expr2
: An expression sharing a least common type with expr1
.A BOOLEAN.
> SELECT equal_null(2, 2);
true
> SELECT equal_null(2, 1);
false
> SELECT equal_null(NULL, 1);
false
> SELECT NULL == 1;
NULL
> SELECT equal_null(NULL, NULL);
true
> SELECT NULL == NULL;
NULL
Training
Module
Combine query results with set operators - Training
Combine query results with set operators using Transact-SQL.