BOOL

    Syntax

    BOOL( expression )
    

    Description

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

    Type FALSE TRUE
    Fractional number | Integer 0, 0.0 All others
    String Empty string ("") All others
    Boolean FALSE TRUE
    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 19.13, Microsoft SQL Server 2017 (14.0), MySQL 5.6, PostgreSQL 9.3.