BOOL

Syntax

BOOL( expression )

Description

Converts the expression expression to Boolean type according to the following rules:

TypeFALSETRUE
Fractional number | Integer0, 0.0All others
StringEmpty string ("")All others
BooleanFALSETRUE
Date | Datetime-TRUE

Argument types:

  • expressionBoolean | Date | Datetime | Fractional number | Geopoint | Geopolygon | Integer | String

Return type: Boolean

Examples

BOOL(0) = FALSE
BOOL(#2019-04-04#) = TRUE
BOOL("Lorem ipsum") = TRUE

Data source support

ClickHouse 21.8, Microsoft SQL Server 2017 (14.0), MySQL 5.7, Oracle Database 12c (12.1), PostgreSQL 9.3, YDB.

Previous
Next