Skip to main content

BOOLEAN type

Applies to: check marked yes Databricks SQL check marked yes Databricks Runtime

Represents Boolean values.

Syntax

BOOLEAN

Limits

The type supports true and false values.

Literals

{ TRUE | FALSE }

Examples

SQL
> SELECT true;
TRUE

> SELECT typeof(false);
BOOLEAN

> SELECT CAST(0 AS BOOLEAN);
FALSE

> SELECT CAST(-1 AS BOOLEAN);
TRUE

> SELECT CAST('true' AS BOOLEAN);
TRUE