Training
Module
Evaluate Boolean expressions to make decisions in C# - Training
Learn the operators and techniques required to evaluate and compare values in your decision statements.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
is true
operatorApplies to: Databricks SQL
Databricks Runtime
Tests whether expr
is true
.
expr is [not] true
expr
: A BOOLEAN or STRING expression.A BOOLEAN.
If expr
is a STRING of case-insensitive value 't'
, 'true'
, 'y'
, 'yes'
, or '1'
it is interpreted as a BOOLEAN true
.
If the value is 'f'
, 'false'
, 'n'
, 'no'
, or '0'
it is interpreted as a BOOLEAN false
.
Any other non-NULL string results in a CAST_INVALID_INPUT error.
If expr
is NULL
the result is false
.
If not
is specified this operator returns true
if expr
is true
or NULL
and false
otherwise.
If not
is not specified the operator returns true
if expr
is false
and false
otherwise.
> SELECT true is true;
true
> SELECT 't' is true;
true
> SELECT false is true;
false
> SELECT NULL is true;
false
> SELECT 'valid' is true;
Error: CAST_INVALID_INPUT
> SELECT true is not true;
false
> SELECT 't' is not true;
false
> SELECT false is not true;
true
> SELECT NULL is not true;
true
Training
Module
Evaluate Boolean expressions to make decisions in C# - Training
Learn the operators and techniques required to evaluate and compare values in your decision statements.